summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_vulkan.h
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2020-05-10 11:47:50 +0100
committerLynne <dev@lynne.ee>2020-05-10 23:20:48 +0100
commitdccd07f66dfc236206bd37633a4666dbe666c0d5 (patch)
tree96d75b06b50e02967400ca2f1cc6f0daef1fddec /libavutil/hwcontext_vulkan.h
parent3c5e5a5095144d72f0ce6387e4ce840f46f454ea (diff)
hwcontext_vulkan: expose enabled device and instance extensions
This solves a huge oversight - it lets users reliably use their own AVVulkanDeviceContext. Otherwise, the extensions supplied and enabled are not discoverable by anything outside of hwcontext_vulkan. Also clarifies that any user-supplied VkInstance must be at least 1.1.
Diffstat (limited to 'libavutil/hwcontext_vulkan.h')
-rw-r--r--libavutil/hwcontext_vulkan.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
index ebc28916f3..7f921d7af1 100644
--- a/libavutil/hwcontext_vulkan.h
+++ b/libavutil/hwcontext_vulkan.h
@@ -39,7 +39,7 @@ typedef struct AVVulkanDeviceContext {
*/
const VkAllocationCallbacks *alloc;
/**
- * Instance
+ * Vulkan instance. Must be at least version 1.1.
*/
VkInstance inst;
/**
@@ -65,6 +65,25 @@ typedef struct AVVulkanDeviceContext {
* Queue family index for compute ops
*/
int queue_family_comp_index;
+ /**
+ * Enabled instance extensions. By default, VK_KHR_surface is enabled if found.
+ * If supplying your own device context, set this to an array of strings, with
+ * each entry containing the specified Vulkan extension string to enable.
+ * Duplicates are possible and accepted.
+ * If no extensions are enabled, set these fields to NULL, and 0 respectively.
+ */
+ const char * const *enabled_inst_extensions;
+ int nb_enabled_inst_extensions;
+ /**
+ * Enabled device extensions. By default, VK_KHR_external_memory_fd,
+ * VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier and
+ * VK_KHR_external_semaphore_fd are enabled if found.
+ * If supplying your own device context, these fields takes the same format as
+ * the above fields, with the same conditions that duplicates are possible
+ * and accepted, and that NULL and 0 respectively means no extensions are enabled.
+ */
+ const char * const *enabled_dev_extensions;
+ int nb_enabled_dev_extensions;
} AVVulkanDeviceContext;
/**