FFmpeg
Data Fields
AVVulkanDeviceContext Struct Reference

Main Vulkan context, allocated as AVHWDeviceContext.hwctx. More...

#include <hwcontext_vulkan.h>

Data Fields

const VkAllocationCallbacks * alloc
 Custom memory allocator, else NULL. More...
 
PFN_vkGetInstanceProcAddr get_proc_addr
 Pointer to a vkGetInstanceProcAddr loading function. More...
 
VkInstance inst
 Vulkan instance. More...
 
VkPhysicalDevice phys_dev
 Physical device. More...
 
VkDevice act_dev
 Active device. More...
 
VkPhysicalDeviceFeatures2 device_features
 This structure should be set to the set of features that present and enabled during device creation. More...
 
const char *const * enabled_inst_extensions
 Enabled instance extensions. More...
 
int nb_enabled_inst_extensions
 
const char *const * enabled_dev_extensions
 Enabled device extensions. More...
 
int nb_enabled_dev_extensions
 
attribute_deprecated int queue_family_index
 Queue family index for graphics operations, and the number of queues enabled for it. More...
 
attribute_deprecated int nb_graphics_queues
 
attribute_deprecated int queue_family_tx_index
 Queue family index for transfer operations and the number of queues enabled. More...
 
attribute_deprecated int nb_tx_queues
 
attribute_deprecated int queue_family_comp_index
 Queue family index for compute operations and the number of queues enabled. More...
 
attribute_deprecated int nb_comp_queues
 
attribute_deprecated int queue_family_encode_index
 Queue family index for video encode ops, and the amount of queues enabled. More...
 
attribute_deprecated int nb_encode_queues
 
attribute_deprecated int queue_family_decode_index
 Queue family index for video decode ops, and the amount of queues enabled. More...
 
attribute_deprecated int nb_decode_queues
 
void(* lock_queue )(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index)
 Locks a queue, preventing other threads from submitting any command buffers to this queue. More...
 
void(* unlock_queue )(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index)
 Similar to lock_queue(), unlocks a queue. More...
 
AVVulkanDeviceQueueFamily qf [64]
 Queue families used. More...
 
int nb_qf
 

Detailed Description

Main Vulkan context, allocated as AVHWDeviceContext.hwctx.

All of these can be set before init to change what the context uses

Definition at line 59 of file hwcontext_vulkan.h.

Field Documentation

◆ alloc

const VkAllocationCallbacks* AVVulkanDeviceContext::alloc

◆ get_proc_addr

PFN_vkGetInstanceProcAddr AVVulkanDeviceContext::get_proc_addr

Pointer to a vkGetInstanceProcAddr loading function.

If unset, will dynamically load and use libvulkan.

Definition at line 69 of file hwcontext_vulkan.h.

Referenced by create_instance(), cuda_device_derive(), ff_vk_load_functions(), init_vulkan(), and load_libvulkan().

◆ inst

VkInstance AVVulkanDeviceContext::inst

Vulkan instance.

Must be at least version 1.3.

Definition at line 74 of file hwcontext_vulkan.h.

Referenced by create_instance(), cuda_device_derive(), ff_vk_load_functions(), find_device(), init_vulkan(), and vulkan_device_free().

◆ phys_dev

VkPhysicalDevice AVVulkanDeviceContext::phys_dev

◆ act_dev

VkDevice AVVulkanDeviceContext::act_dev

◆ device_features

VkPhysicalDeviceFeatures2 AVVulkanDeviceContext::device_features

This structure should be set to the set of features that present and enabled during device creation.

When a device is created by FFmpeg, it will default to enabling all that are present of the shaderImageGatherExtended, fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.

Definition at line 92 of file hwcontext_vulkan.h.

Referenced by init_vulkan(), and vulkan_device_create_internal().

◆ enabled_inst_extensions

const char* const * AVVulkanDeviceContext::enabled_inst_extensions

Enabled instance extensions.

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.

Definition at line 101 of file hwcontext_vulkan.h.

Referenced by create_instance(), ff_vk_filter_init_context(), and vulkan_device_free().

◆ nb_enabled_inst_extensions

int AVVulkanDeviceContext::nb_enabled_inst_extensions

◆ enabled_dev_extensions

const char* const * AVVulkanDeviceContext::enabled_dev_extensions

Enabled device extensions.

By default, VK_KHR_external_memory_fd, VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier, VK_KHR_external_semaphore_fd and VK_EXT_external_memory_host 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.

Definition at line 112 of file hwcontext_vulkan.h.

Referenced by ff_vk_filter_init_context(), init_vulkan(), vulkan_decode_bootstrap(), vulkan_device_create_internal(), vulkan_device_free(), and vulkan_device_init().

◆ nb_enabled_dev_extensions

int AVVulkanDeviceContext::nb_enabled_dev_extensions

◆ queue_family_index

attribute_deprecated int AVVulkanDeviceContext::queue_family_index

Queue family index for graphics operations, and the number of queues enabled for it.

If unavaiable, will be set to -1. Not required. av_hwdevice_create() will attempt to find a dedicated queue for each queue family, or pick the one with the least unrelated flags set. Queue indices here may overlap if a queue has to share capabilities.

Definition at line 124 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ nb_graphics_queues

attribute_deprecated int AVVulkanDeviceContext::nb_graphics_queues

Definition at line 126 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ queue_family_tx_index

attribute_deprecated int AVVulkanDeviceContext::queue_family_tx_index

Queue family index for transfer operations and the number of queues enabled.

Required.

Definition at line 133 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ nb_tx_queues

attribute_deprecated int AVVulkanDeviceContext::nb_tx_queues

Definition at line 135 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ queue_family_comp_index

attribute_deprecated int AVVulkanDeviceContext::queue_family_comp_index

Queue family index for compute operations and the number of queues enabled.

Required.

Definition at line 142 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ nb_comp_queues

attribute_deprecated int AVVulkanDeviceContext::nb_comp_queues

Definition at line 144 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ queue_family_encode_index

attribute_deprecated int AVVulkanDeviceContext::queue_family_encode_index

Queue family index for video encode ops, and the amount of queues enabled.

If the device doesn't support such, queue_family_encode_index will be -1. Not required.

Definition at line 152 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ nb_encode_queues

attribute_deprecated int AVVulkanDeviceContext::nb_encode_queues

Definition at line 154 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ queue_family_decode_index

attribute_deprecated int AVVulkanDeviceContext::queue_family_decode_index

Queue family index for video decode ops, and the amount of queues enabled.

If the device doesn't support such, queue_family_decode_index will be -1. Not required.

Definition at line 162 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ nb_decode_queues

attribute_deprecated int AVVulkanDeviceContext::nb_decode_queues

Definition at line 164 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ lock_queue

void(* AVVulkanDeviceContext::lock_queue) (struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index)

Locks a queue, preventing other threads from submitting any command buffers to this queue.

If set to NULL, will be set to lavu-internal functions that utilize a mutex.

Definition at line 173 of file hwcontext_vulkan.h.

Referenced by vulkan_device_init().

◆ unlock_queue

void(* AVVulkanDeviceContext::unlock_queue) (struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index)

Similar to lock_queue(), unlocks a queue.

Must only be called after locking.

Definition at line 178 of file hwcontext_vulkan.h.

Referenced by vulkan_device_init().

◆ qf

AVVulkanDeviceQueueFamily AVVulkanDeviceContext::qf[64]

Queue families used.

Must be preferentially ordered. List may contain duplicates.

For compatibility reasons, all the enabled queue families listed above (queue_family_(tx/comp/encode/decode)_index) must also be included in this list until they're removed after deprecation.

Definition at line 188 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().

◆ nb_qf

int AVVulkanDeviceContext::nb_qf

Definition at line 189 of file hwcontext_vulkan.h.

Referenced by setup_queue_families(), and vulkan_device_init().


The documentation for this struct was generated from the following file: