diff mbox series

[FFmpeg-devel,1/2] hwcontext_vulkan: optionally enable more functionality

Message ID 20201125115034.75890-1-ffmpeg@haasn.xyz
State Accepted
Commit 3fbc74582f9c3bb941fd63f59fdf25dd16a98a6c
Headers show
Series [FFmpeg-devel,1/2] hwcontext_vulkan: optionally enable more functionality
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Niklas Haas Nov. 25, 2020, 11:50 a.m. UTC
From: Niklas Haas <git@haasn.xyz>

These two extensions and two features are both optionally used by
libplacebo to speed up rendering, so it makes sense for libavutil to
automatically enable them as well.
---
 libavutil/hwcontext_vulkan.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Lynne Nov. 25, 2020, 10:19 p.m. UTC | #1
Nov 25, 2020, 12:50 by ffmpeg@haasn.xyz:

> From: Niklas Haas <git@haasn.xyz>
>
> These two extensions and two features are both optionally used by
> libplacebo to speed up rendering, so it makes sense for libavutil to
> automatically enable them as well.
>

Thanks, pushed.
diff mbox series

Patch

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index a98ea916e7..3fdc09848f 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -210,6 +210,8 @@  enum VulkanExtensions {
     EXT_EXTERNAL_FD_MEMORY     = 1ULL <<  2, /* VK_KHR_external_memory_fd */
     EXT_EXTERNAL_FD_SEM        = 1ULL <<  3, /* VK_KHR_external_semaphore_fd */
     EXT_EXTERNAL_HOST_MEMORY   = 1ULL <<  4, /* VK_EXT_external_memory_host */
+    EXT_PUSH_DESCRIPTORS       = 1ULL <<  5, /* VK_KHR_push_descriptor */
+    EXT_HOST_QUERY_RESET       = 1ULL <<  6, /* VK_EXT_host_query_reset */
 
     EXT_NO_FLAG                = 1ULL << 63,
 };
@@ -229,6 +231,8 @@  static const VulkanOptExtension optional_device_exts[] = {
     { VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME,        EXT_DRM_MODIFIER_FLAGS,     },
     { VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,            EXT_EXTERNAL_FD_SEM,        },
     { VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME,             EXT_EXTERNAL_HOST_MEMORY,   },
+    { VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME,                  EXT_PUSH_DESCRIPTORS,       },
+    { VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME,                 EXT_HOST_QUERY_RESET,       },
 };
 
 /* Converts return values to strings */
@@ -1003,6 +1007,8 @@  static int vulkan_device_create_internal(AVHWDeviceContext *ctx,
     vkGetPhysicalDeviceFeatures(hwctx->phys_dev, &dev_features);
 #define COPY_FEATURE(DST, NAME) (DST).features.NAME = dev_features.NAME;
     COPY_FEATURE(hwctx->device_features, shaderImageGatherExtended)
+    COPY_FEATURE(hwctx->device_features, shaderStorageImageReadWithoutFormat)
+    COPY_FEATURE(hwctx->device_features, shaderStorageImageWriteWithoutFormat)
     COPY_FEATURE(hwctx->device_features, fragmentStoresAndAtomics)
     COPY_FEATURE(hwctx->device_features, vertexPipelineStoresAndAtomics)
     COPY_FEATURE(hwctx->device_features, shaderInt64)