Probe RGBA16F v210 output

This commit is contained in:
Johanness
2026-05-24 21:45:38 +03:00
parent 102b1fb95f
commit 2ff5f2f90b
2 changed files with 22 additions and 4 deletions
+21 -3
View File
@@ -7,6 +7,9 @@
namespace
{
constexpr VkFormat V210_OUTPUT_FORMAT =
VK_FORMAT_R16G16B16A16_SFLOAT;
std::vector<char> readFile(const std::string& path)
{
std::ifstream file(path, std::ios::ate | std::ios::binary);
@@ -222,6 +225,21 @@ void V210ComputeDecoder::createFeedResources(
feed.srcHeight = srcHeight;
feed.srcStride = srcStride;
VkFormatProperties formatProperties{};
vkGetPhysicalDeviceFormatProperties(
physicalDevice,
V210_OUTPUT_FORMAT,
&formatProperties);
const VkFormatFeatureFlags requiredFeatures =
VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT |
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
if ((formatProperties.optimalTilingFeatures & requiredFeatures) !=
requiredFeatures)
{
throw std::runtime_error(
"VK_FORMAT_R16G16B16A16_SFLOAT cannot be used for v210 output");
}
VkDeviceSize v210Size = static_cast<VkDeviceSize>(srcStride) * srcHeight;
createBuffer(
@@ -251,7 +269,7 @@ void V210ComputeDecoder::createFeedResources(
physicalDevice,
dstWidth,
dstHeight,
VK_FORMAT_R8G8B8A8_UNORM,
V210_OUTPUT_FORMAT,
VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_STORAGE_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT,
@@ -264,7 +282,7 @@ void V210ComputeDecoder::createFeedResources(
commandPool,
graphicsQueue,
feed.image,
VK_FORMAT_R8G8B8A8_UNORM,
V210_OUTPUT_FORMAT,
VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_GENERAL);
@@ -272,7 +290,7 @@ void V210ComputeDecoder::createFeedResources(
viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
viewInfo.image = feed.image;
viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
viewInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
viewInfo.format = V210_OUTPUT_FORMAT;
viewInfo.subresourceRange.aspectMask =
VK_IMAGE_ASPECT_COLOR_BIT;
viewInfo.subresourceRange.baseMipLevel = 0;