19#ifndef AVUTIL_HWCONTEXT_VULKAN_H
20#define AVUTIL_HWCONTEXT_VULKAN_H
22#if defined(_WIN32) && !defined(VK_USE_PLATFORM_WIN32_KHR)
23#define VK_USE_PLATFORM_WIN32_KHR
25#include <vulkan/vulkan.h>
46 const VkAllocationCallbacks *
alloc;
reference-counted frame API
#define AV_NUM_DATA_POINTERS
AVVkFrame * av_vk_frame_alloc(void)
Allocates a single AVVkFrame and initializes everything as 0.
const VkFormat * av_vkfmt_from_pixfmt(enum AVPixelFormat p)
Returns the format of each image up to the number of planes for a given sw_format.
AVVkFrameFlags
Defines the behaviour of frame allocation.
@ AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY
AVPixelFormat
Pixel format.
VkAccessFlagBits access[AV_NUM_DATA_POINTERS]
Updated after every barrier.
size_t size[AV_NUM_DATA_POINTERS]
VkImageLayout layout[AV_NUM_DATA_POINTERS]
VkImageTiling tiling
The same tiling must be used for all images in the frame.
VkSemaphore sem[AV_NUM_DATA_POINTERS]
Synchronization timeline semaphores, one for each sw_format plane.
VkMemoryPropertyFlagBits flags
OR'd flags for all memory allocated.
uint64_t sem_value[AV_NUM_DATA_POINTERS]
Up to date semaphore value at which each image becomes accessible.
struct AVVkFrameInternal * internal
Internal data.
ptrdiff_t offset[AV_NUM_DATA_POINTERS]
Describes the binding offset of each plane to the VkDeviceMemory.
VkDeviceMemory mem[AV_NUM_DATA_POINTERS]
Memory backing the images.
VkImage img[AV_NUM_DATA_POINTERS]
Vulkan images to which the memory is bound to.
Main Vulkan context, allocated as AVHWDeviceContext.hwctx.
VkPhysicalDevice phys_dev
Physical device.
int queue_family_tx_index
Queue family index for transfer operations and the number of queues enabled.
int queue_family_encode_index
Queue family index for video encode ops, and the amount of queues enabled.
int queue_family_index
Queue family index for graphics operations, and the number of queues enabled for it.
int nb_enabled_inst_extensions
const char *const * enabled_dev_extensions
Enabled device extensions.
const VkAllocationCallbacks * alloc
Custom memory allocator, else NULL.
VkDevice act_dev
Active device.
int queue_family_comp_index
Queue family index for compute operations and the number of queues enabled.
int queue_family_decode_index
Queue family index for video decode ops, and the amount of queues enabled.
const char *const * enabled_inst_extensions
Enabled instance extensions.
VkInstance inst
Vulkan instance.
VkPhysicalDeviceFeatures2 device_features
This structure should be set to the set of features that present and enabled during device creation.
int nb_enabled_dev_extensions
PFN_vkGetInstanceProcAddr get_proc_addr
Pointer to the instance-provided vkGetInstanceProcAddr loading function.
Allocated as AVHWFramesContext.hwctx, used to set pool-specific options.
void * create_pnext
Extension data for image creation.
VkImageTiling tiling
Controls the tiling of allocated frames.
void * alloc_pnext[AV_NUM_DATA_POINTERS]
Extension data for memory allocation.
VkImageUsageFlagBits usage
Defines extra usage of output frames.
AVVkFrameFlags flags
A combination of AVVkFrameFlags.