mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avutil/hwcontext_vulkan: get VkFormatFeatureFlagBits2
Rather than the VkFormatFeatureFlagBits enum Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
This commit is contained in:
parent
6f39dee974
commit
854012ec59
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user