vkformat: use VK_KHR_get_physical_device_properties2 to guard
and VK_KHR_format_feature_flags2 rather than a meaningless version handling. Also the patch brings back the usage of features2 for video extensions, use KHR version to support the guarded symbols. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6014>
This commit is contained in:
parent
394aaa6a59
commit
c24b47ecee
@ -513,8 +513,8 @@ gst_vulkan_format_from_video_info (GstVideoInfo * v_info, guint plane)
|
|||||||
|
|
||||||
struct vkUsage
|
struct vkUsage
|
||||||
{
|
{
|
||||||
#if (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195)
|
#if defined (VK_KHR_format_feature_flags2)
|
||||||
const VkFormatFeatureFlagBits2 feature;
|
const VkFormatFeatureFlagBits2KHR feature;
|
||||||
#else
|
#else
|
||||||
const VkFormatFeatureFlagBits feature;
|
const VkFormatFeatureFlagBits feature;
|
||||||
#endif
|
#endif
|
||||||
@ -535,14 +535,14 @@ _get_usage (guint64 feature)
|
|||||||
{VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,
|
{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_VIDEO_DECODE_OUTPUT_BIT_KHR,
|
{VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR,
|
||||||
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR},
|
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR},
|
||||||
{VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR,
|
{VK_FORMAT_FEATURE_2_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_VIDEO_ENCODE_DPB_BIT_KHR,
|
{VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR,
|
||||||
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR},
|
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR},
|
||||||
{VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR,
|
{VK_FORMAT_FEATURE_2_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
|
||||||
@ -580,11 +580,11 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
VkPhysicalDevice gpu;
|
VkPhysicalDevice gpu;
|
||||||
#if (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195)
|
#if defined (VK_KHR_get_physical_device_properties2)
|
||||||
VkFormatProperties2 prop = {
|
VkFormatProperties2KHR prop = {
|
||||||
.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
|
.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR,
|
||||||
};
|
};
|
||||||
PFN_vkGetPhysicalDeviceFormatProperties2
|
PFN_vkGetPhysicalDeviceFormatProperties2KHR
|
||||||
gst_vkGetPhysicalDeviceFormatProperties2 = NULL;
|
gst_vkGetPhysicalDeviceFormatProperties2 = NULL;
|
||||||
|
|
||||||
gst_vkGetPhysicalDeviceFormatProperties2 =
|
gst_vkGetPhysicalDeviceFormatProperties2 =
|
||||||
@ -607,7 +607,7 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device,
|
|||||||
if (vk_formats_map[i].format != GST_VIDEO_INFO_FORMAT (info))
|
if (vk_formats_map[i].format != GST_VIDEO_INFO_FORMAT (info))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195)
|
#if defined (VK_KHR_get_physical_device_properties2)
|
||||||
if (gst_vkGetPhysicalDeviceFormatProperties2) {
|
if (gst_vkGetPhysicalDeviceFormatProperties2) {
|
||||||
gst_vkGetPhysicalDeviceFormatProperties2 (gpu, vk_formats_map[i].vkfrmt,
|
gst_vkGetPhysicalDeviceFormatProperties2 (gpu, vk_formats_map[i].vkfrmt,
|
||||||
&prop);
|
&prop);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user