diff options
author | Lynne <dev@lynne.ee> | 2023-02-17 03:15:02 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:39 +0200 |
commit | f50bc930a4fc83c7b222fcbf97e05ff9f6096c8b (patch) | |
tree | 266dafd1afaa624ac60b4067f55cfbf9c6031753 /libavutil/hwcontext_vulkan.c | |
parent | c5702abf71d3edf41cbde7bf37093788bba183ee (diff) | |
download | ffmpeg-f50bc930a4fc83c7b222fcbf97e05ff9f6096c8b.tar.gz |
hwcontext_vulkan: add support for descriptor buffers
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r-- | libavutil/hwcontext_vulkan.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 8f80cc8e21..e68c4e3535 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -91,6 +91,7 @@ typedef struct VulkanDevicePriv { VkPhysicalDeviceVulkan11Features device_features_1_1; VkPhysicalDeviceVulkan12Features device_features_1_2; VkPhysicalDeviceVulkan13Features device_features_1_3; + VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features; /* Queues */ pthread_mutex_t **qf_mutex; @@ -351,6 +352,7 @@ static const VulkanOptExtension optional_device_exts[] = { { VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, { VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, { VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, + { VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME, FF_VK_EXT_DESCRIPTOR_BUFFER, }, /* Imports/exports */ { VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_MEMORY }, @@ -1336,9 +1338,13 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, VkPhysicalDeviceTimelineSemaphoreFeatures timeline_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, }; + VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT, + .pNext = &timeline_features, + }; VkPhysicalDeviceVulkan13Features dev_features_1_3 = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES, - .pNext = &timeline_features, + .pNext = &desc_buf_features, }; VkPhysicalDeviceVulkan12Features dev_features_1_2 = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES, @@ -1364,6 +1370,8 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->device_features_1_2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; p->device_features_1_2.pNext = &p->device_features_1_3; p->device_features_1_3.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; + p->device_features_1_3.pNext = &p->desc_buf_features; + p->desc_buf_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; ctx->free = vulkan_device_free; /* Create an instance if not given one */ @@ -1393,8 +1401,11 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, goto end; } p->device_features_1_2.timelineSemaphore = 1; + p->device_features_1_2.bufferDeviceAddress = dev_features_1_2.bufferDeviceAddress; p->device_features_1_1.samplerYcbcrConversion = dev_features_1_1.samplerYcbcrConversion; p->device_features_1_3.synchronization2 = dev_features_1_3.synchronization2; + p->desc_buf_features.descriptorBuffer = desc_buf_features.descriptorBuffer; + p->desc_buf_features.descriptorBufferPushDescriptors = desc_buf_features.descriptorBufferPushDescriptors; dev_info.pNext = &hwctx->device_features; |