diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 521ad76690..b4130abcde 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -298,8 +298,12 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p, for (int i = 0; i < nb_vk_formats_list; i++) { if (vk_formats_list[i].pixfmt == p) { + VkFormatProperties3 fprops = { + .sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3, + }; VkFormatProperties2 prop = { .sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, + .pNext = &fprops, }; VkFormatFeatureFlagBits2 feats_primary, feats_secondary; int basics_primary = 0, basics_secondary = 0; @@ -310,8 +314,7 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p, &prop); feats_primary = tiling == VK_IMAGE_TILING_LINEAR ? - prop.formatProperties.linearTilingFeatures : - prop.formatProperties.optimalTilingFeatures; + fprops.linearTilingFeatures : fprops.optimalTilingFeatures; basics_primary = (feats_primary & basic_flags) == basic_flags; storage_primary = !!(feats_primary & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT); @@ -320,8 +323,7 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p, vk_formats_list[i].fallback[0], &prop); feats_secondary = tiling == VK_IMAGE_TILING_LINEAR ? - prop.formatProperties.linearTilingFeatures : - prop.formatProperties.optimalTilingFeatures; + fprops.linearTilingFeatures : fprops.optimalTilingFeatures; basics_secondary = (feats_secondary & basic_flags) == basic_flags; storage_secondary = !!(feats_secondary & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT); } else {