vulkan/context: make use of VK_EXT_shader_object only if available

VK_EXT_shader_object was added in 1.3.246, mpv currently requires
1.3.238. Debian stable is at 1.3.239.

Fixes build on Debian stable (Bookworm).

Fixes: #15041
Fixes: 2ac1d6db32
This commit is contained in:
Kacper Michajłow 2024-10-10 17:58:00 +02:00
parent c8860fd816
commit ac7e9247b2
1 changed files with 6 additions and 1 deletions

View File

@ -185,7 +185,9 @@ pl_vulkan mppl_create_vulkan(struct vulkan_opts *opts,
const char *opt_extensions[] = { const char *opt_extensions[] = {
VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME, VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME,
VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME,
#ifdef VK_EXT_SHADER_OBJECT_EXTENSION_NAME
VK_EXT_SHADER_OBJECT_EXTENSION_NAME, VK_EXT_SHADER_OBJECT_EXTENSION_NAME,
#endif
VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME,
VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME, VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME,
VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME, VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME,
@ -193,15 +195,18 @@ pl_vulkan mppl_create_vulkan(struct vulkan_opts *opts,
"VK_KHR_video_decode_av1", /* VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME */ "VK_KHR_video_decode_av1", /* VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME */
}; };
#ifdef VK_EXT_SHADER_OBJECT_EXTENSION_NAME
VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_feature = { VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_feature = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT, .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT,
.pNext = NULL,
.shaderObject = true, .shaderObject = true,
}; };
#endif
VkPhysicalDeviceDescriptorBufferFeaturesEXT descriptor_buffer_feature = { VkPhysicalDeviceDescriptorBufferFeaturesEXT descriptor_buffer_feature = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT, .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT,
#ifdef VK_EXT_SHADER_OBJECT_EXTENSION_NAME
.pNext = &shader_object_feature, .pNext = &shader_object_feature,
#endif
.descriptorBuffer = true, .descriptorBuffer = true,
.descriptorBufferPushDescriptors = true, .descriptorBufferPushDescriptors = true,
}; };