Commit 854012ec authored by Víctor Manuel Jáquez Leal's avatar Víctor Manuel Jáquez Leal Committed by Lynne

avutil/hwcontext_vulkan: get VkFormatFeatureFlagBits2

Rather than the VkFormatFeatureFlagBits enum
Signed-off-by: 's avatarVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
parent 6f39dee9
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment