vulkan/format: there is no current need to use the 64-bit feature flags

All of our feature flags are currently covered by the first
VkFormatFeatureFlag enum so far.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5576>
This commit is contained in:
Matthew Waters 2023-10-30 15:52:44 +11:00 committed by GStreamer Marge Bot
parent 080b25cbfe
commit 420548a6c6

View file

@ -511,11 +511,13 @@ gst_vulkan_format_from_video_info (GstVideoInfo * v_info, guint plane)
return VK_FORMAT_UNDEFINED; return VK_FORMAT_UNDEFINED;
} }
#if (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195)
struct vkUsage struct vkUsage
{ {
#if (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195)
const VkFormatFeatureFlagBits2 feature; const VkFormatFeatureFlagBits2 feature;
#else
const VkFormatFeatureFlagBits feature;
#endif
VkImageUsageFlags usage; VkImageUsageFlags usage;
}; };
@ -526,21 +528,21 @@ _get_usage (guint64 feature)
VkImageUsageFlags usage = 0; VkImageUsageFlags usage = 0;
/* *INDENT-OFF* */ /* *INDENT-OFF* */
const struct vkUsage vk_usage_map[] = { const struct vkUsage vk_usage_map[] = {
{VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR, VK_IMAGE_USAGE_SAMPLED_BIT}, {VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, VK_IMAGE_USAGE_SAMPLED_BIT},
{VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR, VK_IMAGE_USAGE_TRANSFER_SRC_BIT}, {VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, VK_IMAGE_USAGE_TRANSFER_SRC_BIT},
{VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR, VK_IMAGE_USAGE_TRANSFER_DST_BIT}, {VK_FORMAT_FEATURE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_TRANSFER_DST_BIT},
{VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR, VK_IMAGE_USAGE_STORAGE_BIT}, {VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, VK_IMAGE_USAGE_STORAGE_BIT},
{VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR, {VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT}, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT},
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS #if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
{VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR, {VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR,
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR}, VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR},
{VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR, {VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR,
VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR}, VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR},
#ifdef VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS
{VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR, {VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR,
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR}, VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR},
{VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR, {VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR,
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR}, VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR},
#endif #endif
#endif #endif
@ -554,16 +556,6 @@ _get_usage (guint64 feature)
return usage; return usage;
} }
#else
static VkImageUsageFlags
_get_usage (guint64 feature)
{
/* return what GstVulkan has been using since it was merged */
return VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT
| VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
}
#endif /* (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195) */
/** /**
* gst_vulkan_format_from_video_info_2: (skip) * gst_vulkan_format_from_video_info_2: (skip)