FFmpeg
|
Go to the source code of this file.
Data Structures | |
struct | TempSyncCtx |
struct | ImageViewCtx |
struct | descriptor_props |
Macros | |
#define | CASE(VAL) case VAL: return #VAL |
#define | ARR_REALLOC(str, arr, alloc_s, cnt) |
#define | REPS_FMT(fmt) |
#define | REPS_FMT_PACK(fmt, num) |
#define | REMAP(src, dst) |
Functions | |
const char * | ff_vk_ret2str (VkResult res) |
Converts Vulkan return values to strings. More... | |
static void | load_enabled_qfs (FFVulkanContext *s) |
int | ff_vk_load_props (FFVulkanContext *s) |
Loads props/mprops/driver_props. More... | |
AVVulkanDeviceQueueFamily * | ff_vk_qf_find (FFVulkanContext *s, VkQueueFlagBits dev_family, VkVideoCodecOperationFlagBitsKHR vid_ops) |
Chooses an appropriate QF. More... | |
void | ff_vk_exec_pool_free (FFVulkanContext *s, FFVkExecPool *pool) |
int | ff_vk_exec_pool_init (FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf, FFVkExecPool *pool, int nb_contexts, int nb_queries, VkQueryType query_type, int query_64bit, const void *query_create_pnext) |
Allocates/frees an execution pool. More... | |
VkResult | ff_vk_exec_get_query (FFVulkanContext *s, FFVkExecContext *e, void **data, VkQueryResultFlagBits flags) |
Performs nb_queries queries and returns their results and statuses. More... | |
FFVkExecContext * | ff_vk_exec_get (FFVulkanContext *s, FFVkExecPool *pool) |
Retrieve an execution pool. More... | |
void | ff_vk_exec_wait (FFVulkanContext *s, FFVkExecContext *e) |
int | ff_vk_exec_start (FFVulkanContext *s, FFVkExecContext *e) |
Start/submit/wait an execution. More... | |
void | ff_vk_exec_discard_deps (FFVulkanContext *s, FFVkExecContext *e) |
int | ff_vk_exec_add_dep_buf (FFVulkanContext *s, FFVkExecContext *e, AVBufferRef **deps, int nb_deps, int ref) |
Execution dependency management. More... | |
int | ff_vk_exec_add_dep_sw_frame (FFVulkanContext *s, FFVkExecContext *e, AVFrame *f) |
static void | destroy_tmp_semaphores (void *opaque, uint8_t *data) |
int | ff_vk_exec_add_dep_wait_sem (FFVulkanContext *s, FFVkExecContext *e, VkSemaphore sem, uint64_t val, VkPipelineStageFlagBits2 stage) |
int | ff_vk_exec_add_dep_bool_sem (FFVulkanContext *s, FFVkExecContext *e, VkSemaphore *sem, int nb, VkPipelineStageFlagBits2 stage, int wait) |
int | ff_vk_exec_add_dep_frame (FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, VkPipelineStageFlagBits2 wait_stage, VkPipelineStageFlagBits2 signal_stage) |
void | ff_vk_exec_update_frame (FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, VkImageMemoryBarrier2 *bar, uint32_t *nb_img_bar) |
int | ff_vk_exec_mirror_sem_value (FFVulkanContext *s, FFVkExecContext *e, VkSemaphore *dst, uint64_t *dst_val, AVFrame *f) |
int | ff_vk_exec_submit (FFVulkanContext *s, FFVkExecContext *e) |
int | ff_vk_alloc_mem (FFVulkanContext *s, VkMemoryRequirements *req, VkMemoryPropertyFlagBits req_flags, void *alloc_extension, VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem) |
Memory/buffer/image allocation helpers. More... | |
int | ff_vk_create_buf (FFVulkanContext *s, FFVkBuffer *buf, size_t size, void *pNext, void *alloc_pNext, VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags) |
int | ff_vk_map_buffers (FFVulkanContext *s, FFVkBuffer **buf, uint8_t *mem[], int nb_buffers, int invalidate) |
Buffer management code. More... | |
int | ff_vk_unmap_buffers (FFVulkanContext *s, FFVkBuffer **buf, int nb_buffers, int flush) |
void | ff_vk_free_buf (FFVulkanContext *s, FFVkBuffer *buf) |
static void | free_data_buf (void *opaque, uint8_t *data) |
static AVBufferRef * | alloc_data_buf (void *opaque, size_t size) |
int | ff_vk_get_pooled_buffer (FFVulkanContext *ctx, AVBufferPool **buf_pool, AVBufferRef **buf, VkBufferUsageFlags usage, void *create_pNext, size_t size, VkMemoryPropertyFlagBits mem_props) |
Initialize a pool and create AVBufferRefs containing FFVkBuffer. More... | |
static int | create_mapped_buffer (FFVulkanContext *s, FFVkBuffer *vkb, VkBufferUsageFlags usage, size_t size, VkExternalMemoryBufferCreateInfo *create_desc, VkImportMemoryHostPointerInfoEXT *import_desc, VkMemoryHostPointerPropertiesEXT props) |
static void | destroy_avvkbuf (void *opaque, uint8_t *data) |
int | ff_vk_host_map_buffer (FFVulkanContext *s, AVBufferRef **dst, uint8_t *src_data, const AVBufferRef *src_buf, VkBufferUsageFlags usage) |
Maps a system RAM buffer into a Vulkan buffer. More... | |
int | ff_vk_shader_add_push_const (FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage) |
Add/update push constants for execution. More... | |
int | ff_vk_init_sampler (FFVulkanContext *s, VkSampler *sampler, int unnorm_coords, VkFilter filt) |
Create a sampler. More... | |
VkImageAspectFlags | ff_vk_aspect_flag (AVFrame *f, int p) |
Get the aspect flag for a plane from an image. More... | |
int | ff_vk_mt_is_np_rgb (enum AVPixelFormat pix_fmt) |
Returns 1 if pixfmt is a usable RGB format. More... | |
void | ff_vk_set_perm (enum AVPixelFormat pix_fmt, int lut[4], int inv) |
Since storage images may not be swizzled, we have to do this in the shader itself. More... | |
const char * | ff_vk_shader_rep_fmt (enum AVPixelFormat pix_fmt, enum FFVkShaderRepFormat rep_fmt) |
static void | destroy_imageviews (void *opaque, uint8_t *data) |
static VkFormat | map_fmt_to_rep (VkFormat fmt, enum FFVkShaderRepFormat rep_fmt) |
static void | bgr_workaround (AVVulkanFramesContext *vkfc, VkImageViewCreateInfo *ci) |
int | ff_vk_create_imageview (FFVulkanContext *s, VkImageView *img_view, VkImageAspectFlags *aspect, AVFrame *f, int plane, enum FFVkShaderRepFormat rep_fmt) |
Create a single imageview for a given plane. More... | |
int | ff_vk_create_imageviews (FFVulkanContext *s, FFVkExecContext *e, VkImageView views[AV_NUM_DATA_POINTERS], AVFrame *f, enum FFVkShaderRepFormat rep_fmt) |
Create an imageview and add it as a dependency to an execution. More... | |
void | ff_vk_frame_barrier (FFVulkanContext *s, FFVkExecContext *e, AVFrame *pic, VkImageMemoryBarrier2 *bar, int *nb_bar, VkPipelineStageFlags src_stage, VkPipelineStageFlags dst_stage, VkAccessFlagBits new_access, VkImageLayout new_layout, uint32_t new_qf) |
int | ff_vk_shader_init (FFVulkanContext *s, FFVulkanShader *shd, const char *name, VkPipelineStageFlags stage, const char *extensions[], int nb_extensions, int lg_x, int lg_y, int lg_z, uint32_t required_subgroup_size) |
Initialize a shader object, with a specific set of extensions, type+bind, local group size, and subgroup requirements. More... | |
void | ff_vk_shader_print (void *ctx, FFVulkanShader *shd, int prio) |
Output the shader code as logging data, with a specific priority. More... | |
static int | init_pipeline_layout (FFVulkanContext *s, FFVulkanShader *shd) |
static int | create_shader_module (FFVulkanContext *s, FFVulkanShader *shd, VkShaderModule *mod, uint8_t *spirv, size_t spirv_len) |
static int | init_compute_pipeline (FFVulkanContext *s, FFVulkanShader *shd, VkShaderModule mod, const char *entrypoint) |
static int | create_shader_object (FFVulkanContext *s, FFVulkanShader *shd, uint8_t *spirv, size_t spirv_len, const char *entrypoint) |
static int | init_descriptors (FFVulkanContext *s, FFVulkanShader *shd) |
int | ff_vk_shader_link (FFVulkanContext *s, FFVulkanShader *shd, uint8_t *spirv, size_t spirv_len, const char *entrypoint) |
Link a shader into an executable. More... | |
int | ff_vk_shader_add_descriptor_set (FFVulkanContext *s, FFVulkanShader *shd, FFVulkanDescriptorSetBinding *desc, int nb, int singular, int print_to_shader_only) |
Add descriptor to a shader. More... | |
int | ff_vk_shader_register_exec (FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd) |
Register a shader with an exec pool. More... | |
static FFVulkanShaderData * | get_shd_data (FFVkExecContext *e, FFVulkanShader *shd) |
static void | update_set_descriptor (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, int set, int bind_idx, int array_idx, VkDescriptorGetInfoEXT *desc_get_info, size_t desc_size) |
static void | update_set_pool_write (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, int set, VkWriteDescriptorSet *write_info) |
int | ff_vk_shader_update_img (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, int set, int bind, int offs, VkImageView view, VkImageLayout layout, VkSampler sampler) |
Sets an image descriptor for specified shader and binding. More... | |
void | ff_vk_shader_update_img_array (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, AVFrame *f, VkImageView *views, int set, int binding, VkImageLayout layout, VkSampler sampler) |
Update a descriptor in a buffer with an image array. More... | |
int | ff_vk_shader_update_desc_buffer (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, int set, int bind, int elem, FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize len, VkFormat fmt) |
Update a descriptor in a buffer with a buffer. More... | |
void | ff_vk_shader_update_push_const (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, VkShaderStageFlagBits stage, int offset, size_t size, void *src) |
Update push constant in a shader. More... | |
void | ff_vk_exec_bind_shader (FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd) |
Bind a shader. More... | |
void | ff_vk_shader_free (FFVulkanContext *s, FFVulkanShader *shd) |
Free a shader. More... | |
void | ff_vk_uninit (FFVulkanContext *s) |
Frees main context. More... | |
int | ff_vk_init (FFVulkanContext *s, void *log_parent, AVBufferRef *device_ref, AVBufferRef *frames_ref) |
Initializes the AVClass, in case this context is not used as the main user's context. More... | |
Variables | |
const VkComponentMapping | ff_comp_identity_map |
static const struct descriptor_props | descriptor_props [] |
#define CASE | ( | VAL | ) | case VAL: return #VAL |
#define ARR_REALLOC | ( | str, | |
arr, | |||
alloc_s, | |||
cnt | |||
) |
#define REPS_FMT | ( | fmt | ) |
#define REPS_FMT_PACK | ( | fmt, | |
num | |||
) |
const char* ff_vk_ret2str | ( | VkResult | res | ) |
Converts Vulkan return values to strings.
Definition at line 35 of file vulkan.c.
Referenced by alloc_bind_mem(), alloc_mem(), create_empty_session_parameters(), create_frame(), create_instance(), create_shader_module(), create_shader_object(), ff_vk_create_buf(), ff_vk_create_imageview(), ff_vk_create_imageviews(), ff_vk_decode_create_params(), ff_vk_decode_frame(), ff_vk_exec_pool_init(), ff_vk_exec_start(), ff_vk_exec_submit(), ff_vk_init_sampler(), ff_vk_map_buffers(), ff_vk_shader_register_exec(), ff_vk_unmap_buffers(), ff_vulkan_encode_create_session_params(), ff_vulkan_encode_init(), find_device(), init_compute_pipeline(), init_descriptors(), init_pipeline_layout(), vulkan_decode_get_profile(), vulkan_device_create_internal(), and vulkan_encode_output().
|
static |
Definition at line 87 of file vulkan.c.
Referenced by ff_vk_load_props().
int ff_vk_load_props | ( | FFVulkanContext * | s | ) |
Loads props/mprops/driver_props.
Definition at line 106 of file vulkan.c.
Referenced by ff_vk_filter_init_context(), ff_vk_init(), ff_vulkan_encode_init(), and vulkan_device_init().
AVVulkanDeviceQueueFamily* ff_vk_qf_find | ( | FFVulkanContext * | s, |
VkQueueFlagBits | dev_family, | ||
VkVideoCodecOperationFlagBitsKHR | vid_ops | ||
) |
Chooses an appropriate QF.
Definition at line 220 of file vulkan.c.
Referenced by ff_vk_decode_init(), ff_vulkan_encode_init(), init_filter(), init_vulkan(), vulkan_device_init(), and vulkan_encode_ffv1_init().
void ff_vk_exec_pool_free | ( | FFVulkanContext * | s, |
FFVkExecPool * | pool | ||
) |
Definition at line 233 of file vulkan.c.
Referenced by avgblur_vulkan_uninit(), bwdif_vulkan_uninit(), chromaber_vulkan_uninit(), ff_vk_exec_pool_init(), ff_vulkan_encode_uninit(), flip_vulkan_uninit(), free_common(), gblur_vulkan_uninit(), interlace_vulkan_uninit(), overlay_vulkan_uninit(), scale_vulkan_uninit(), testsrc_vulkan_uninit(), transpose_vulkan_uninit(), uninit(), vulkan_encode_ffv1_close(), and vulkan_frames_uninit().
int ff_vk_exec_pool_init | ( | FFVulkanContext * | s, |
AVVulkanDeviceQueueFamily * | qf, | ||
FFVkExecPool * | pool, | ||
int | nb_contexts, | ||
int | nb_queries, | ||
VkQueryType | query_type, | ||
int | query_64bit, | ||
const void * | query_create_pnext | ||
) |
Allocates/frees an execution pool.
If used in a multi-threaded context, there must be at least as many contexts as there are threads. ff_vk_exec_pool_init_desc() MUST be called if ff_vk_exec_descriptor_set_add() has been called.
Definition at line 296 of file vulkan.c.
Referenced by ff_vk_decode_init(), ff_vulkan_encode_init(), init_filter(), init_vulkan(), vulkan_encode_ffv1_init(), and vulkan_frames_init().
VkResult ff_vk_exec_get_query | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
void ** | data, | ||
VkQueryResultFlagBits | flags | ||
) |
Performs nb_queries queries and returns their results and statuses.
64_BIT and WITH_STATUS flags are ignored as 64_BIT must be specified via query_64bit in ff_vk_exec_pool_init() and WITH_STATUS is always enabled.
Definition at line 449 of file vulkan.c.
Referenced by vulkan_encode_output().
FFVkExecContext* ff_vk_exec_get | ( | FFVulkanContext * | s, |
FFVkExecPool * | pool | ||
) |
Retrieve an execution pool.
Threadsafe.
Definition at line 477 of file vulkan.c.
Referenced by download_slices(), ff_vk_decode_flush(), ff_vk_decode_frame(), ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), prepare_frame(), vk_ffv1_end_frame(), vulkan_encode_ffv1_receive_packet(), vulkan_encode_issue(), and vulkan_transfer_frame().
void ff_vk_exec_wait | ( | FFVulkanContext * | s, |
FFVkExecContext * | e | ||
) |
Definition at line 482 of file vulkan.c.
Referenced by download_slices(), get_packet(), vulkan_encode_wait(), and vulkan_transfer_frame().
int ff_vk_exec_start | ( | FFVulkanContext * | s, |
FFVkExecContext * | e | ||
) |
Start/submit/wait an execution.
ff_vk_exec_start() always waits on a submission, so using ff_vk_exec_wait() is not necessary (unless using it is just better).
Definition at line 489 of file vulkan.c.
Referenced by download_slices(), ff_vk_decode_flush(), ff_vk_decode_frame(), ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), prepare_frame(), vk_ffv1_end_frame(), vulkan_encode_ffv1_submit_frame(), vulkan_encode_issue(), and vulkan_transfer_frame().
void ff_vk_exec_discard_deps | ( | FFVulkanContext * | s, |
FFVkExecContext * | e | ||
) |
Definition at line 521 of file vulkan.c.
Referenced by ff_vk_exec_add_dep_buf(), ff_vk_exec_add_dep_frame(), ff_vk_exec_add_dep_sw_frame(), ff_vk_exec_pool_free(), ff_vk_exec_start(), ff_vk_exec_submit(), ff_vk_exec_wait(), ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), prepare_frame(), vulkan_encode_ffv1_submit_frame(), and vulkan_transfer_frame().
int ff_vk_exec_add_dep_buf | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
AVBufferRef ** | deps, | ||
int | nb_deps, | ||
int | ref | ||
) |
Execution dependency management.
Can attach buffers to executions that will only be unref'd once the buffer has finished executing. Adding a frame dep will lock the frame, until either the dependencies are discarded, the execution is submitted, or a failure happens. update_frame will update the frame's properties before it is unlocked, only if submission was successful.
Definition at line 549 of file vulkan.c.
Referenced by download_slices(), ff_vk_create_imageviews(), ff_vk_decode_frame(), ff_vk_exec_add_dep_bool_sem(), vk_ffv1_end_frame(), vulkan_encode_ffv1_submit_frame(), vulkan_encode_issue(), and vulkan_transfer_frame().
int ff_vk_exec_add_dep_sw_frame | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
AVFrame * | f | ||
) |
Definition at line 573 of file vulkan.c.
Referenced by vulkan_transfer_frame().
|
static |
Definition at line 611 of file vulkan.c.
Referenced by ff_vk_exec_add_dep_bool_sem().
int ff_vk_exec_add_dep_wait_sem | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
VkSemaphore | sem, | ||
uint64_t | val, | ||
VkPipelineStageFlagBits2 | stage | ||
) |
Definition at line 623 of file vulkan.c.
Referenced by ff_vk_exec_add_dep_bool_sem(), and vk_ffv1_end_frame().
int ff_vk_exec_add_dep_bool_sem | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
VkSemaphore * | sem, | ||
int | nb, | ||
VkPipelineStageFlagBits2 | stage, | ||
int | wait | ||
) |
int ff_vk_exec_add_dep_frame | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
AVFrame * | f, | ||
VkPipelineStageFlagBits2 | wait_stage, | ||
VkPipelineStageFlagBits2 | signal_stage | ||
) |
Definition at line 706 of file vulkan.c.
Referenced by ff_vk_decode_frame(), ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), prepare_frame(), run_rct(), vk_ffv1_end_frame(), vulkan_encode_ffv1_submit_frame(), vulkan_encode_issue(), and vulkan_transfer_frame().
void ff_vk_exec_update_frame | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
AVFrame * | f, | ||
VkImageMemoryBarrier2 * | bar, | ||
uint32_t * | nb_img_bar | ||
) |
Definition at line 786 of file vulkan.c.
Referenced by ff_vk_decode_frame(), ff_vk_frame_barrier(), and vulkan_encode_issue().
int ff_vk_exec_mirror_sem_value | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
VkSemaphore * | dst, | ||
uint64_t * | dst_val, | ||
AVFrame * | f | ||
) |
Definition at line 805 of file vulkan.c.
Referenced by ff_vk_decode_frame(), and vk_ffv1_end_frame().
int ff_vk_exec_submit | ( | FFVulkanContext * | s, |
FFVkExecContext * | e | ||
) |
Definition at line 831 of file vulkan.c.
Referenced by download_slices(), ff_vk_decode_flush(), ff_vk_decode_frame(), ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), prepare_frame(), vk_ffv1_end_frame(), vulkan_encode_ffv1_submit_frame(), vulkan_encode_issue(), and vulkan_transfer_frame().
int ff_vk_alloc_mem | ( | FFVulkanContext * | s, |
VkMemoryRequirements * | req, | ||
VkMemoryPropertyFlagBits | req_flags, | ||
void * | alloc_extension, | ||
VkMemoryPropertyFlagBits * | mem_flags, | ||
VkDeviceMemory * | mem | ||
) |
Memory/buffer/image allocation helpers.
Definition at line 897 of file vulkan.c.
Referenced by create_mapped_buffer(), ff_vk_create_buf(), and ff_vk_video_common_init().
int ff_vk_create_buf | ( | FFVulkanContext * | s, |
FFVkBuffer * | buf, | ||
size_t | size, | ||
void * | pNext, | ||
void * | alloc_pNext, | ||
VkBufferUsageFlags | usage, | ||
VkMemoryPropertyFlagBits | flags | ||
) |
Definition at line 948 of file vulkan.c.
Referenced by ff_ffv1_vk_init_crc_table_data(), ff_ffv1_vk_init_quant_table_data(), ff_vk_get_pooled_buffer(), ff_vk_shader_register_exec(), init_gblur_pipeline(), and init_state_transition_data().
int ff_vk_map_buffers | ( | FFVulkanContext * | s, |
FFVkBuffer ** | buf, | ||
uint8_t * | mem[], | ||
int | nb_buffers, | ||
int | invalidate | ||
) |
int ff_vk_unmap_buffers | ( | FFVulkanContext * | s, |
FFVkBuffer ** | buf, | ||
int | nb_buffers, | ||
int | flush | ||
) |
Definition at line 1087 of file vulkan.c.
Referenced by ff_vk_unmap_buffer().
void ff_vk_free_buf | ( | FFVulkanContext * | s, |
FFVkBuffer * | buf | ||
) |
Definition at line 1129 of file vulkan.c.
Referenced by destroy_avvkbuf(), ff_vk_exec_pool_free(), ff_vk_get_pooled_buffer(), free_data_buf(), gblur_vulkan_uninit(), vk_decode_ffv1_uninit(), and vulkan_encode_ffv1_close().
|
static |
Definition at line 1150 of file vulkan.c.
Referenced by alloc_data_buf().
|
static |
Definition at line 1158 of file vulkan.c.
Referenced by ff_vk_get_pooled_buffer().
int ff_vk_get_pooled_buffer | ( | FFVulkanContext * | ctx, |
AVBufferPool ** | buf_pool, | ||
AVBufferRef ** | buf, | ||
VkBufferUsageFlags | usage, | ||
void * | create_pNext, | ||
size_t | size, | ||
VkMemoryPropertyFlagBits | mem_props | ||
) |
Initialize a pool and create AVBufferRefs containing FFVkBuffer.
Threadsafe to use. Buffers are automatically mapped on creation if VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is set in mem_props. Users should synchronize access themselvesd. Mainly meant for device-local buffers.
Definition at line 1171 of file vulkan.c.
Referenced by ff_vk_decode_add_slice(), get_packet(), get_plane_buf(), vk_ffv1_start_frame(), vulkan_encode_ffv1_submit_frame(), and vulkan_encode_issue().
|
static |
Definition at line 1224 of file vulkan.c.
Referenced by ff_vk_host_map_buffer().
|
static |
Definition at line 1270 of file vulkan.c.
Referenced by ff_vk_host_map_buffer().
int ff_vk_host_map_buffer | ( | FFVulkanContext * | s, |
AVBufferRef ** | dst, | ||
uint8_t * | src_data, | ||
const AVBufferRef * | src_buf, | ||
VkBufferUsageFlags | usage | ||
) |
Maps a system RAM buffer into a Vulkan buffer.
References the source buffer.
Definition at line 1278 of file vulkan.c.
Referenced by host_map_frame(), and vk_ffv1_start_frame().
int ff_vk_shader_add_push_const | ( | FFVulkanShader * | shd, |
int | offset, | ||
int | size, | ||
VkShaderStageFlagBits | stage | ||
) |
Add/update push constants for execution.
Definition at line 1375 of file vulkan.c.
Referenced by add_push_data(), init_filter(), init_rct_shader(), init_reset_shader(), and init_vulkan().
int ff_vk_init_sampler | ( | FFVulkanContext * | s, |
VkSampler * | sampler, | ||
int | unnorm_coords, | ||
VkFilter | filt | ||
) |
Create a sampler.
Definition at line 1396 of file vulkan.c.
Referenced by init_filter(), and init_vulkan().
VkImageAspectFlags ff_vk_aspect_flag | ( | AVFrame * | f, |
int | p | ||
) |
Get the aspect flag for a plane from an image.
Definition at line 1428 of file vulkan.c.
Referenced by ff_vk_create_imageview(), ff_vk_create_imageviews(), and vulkan_transfer_frame().
int ff_vk_mt_is_np_rgb | ( | enum AVPixelFormat | pix_fmt | ) |
Returns 1 if pixfmt is a usable RGB format.
Definition at line 1445 of file vulkan.c.
Referenced by ff_vk_aspect_flag(), run_rct(), scale_vulkan_config_output(), and vk_ffv1_end_frame().
void ff_vk_set_perm | ( | enum AVPixelFormat | pix_fmt, |
int | lut[4], | ||
int | inv | ||
) |
Since storage images may not be swizzled, we have to do this in the shader itself.
This fills in a lookup table to do it.
Definition at line 1466 of file vulkan.c.
Referenced by run_rct(), and vk_ffv1_end_frame().
const char* ff_vk_shader_rep_fmt | ( | enum AVPixelFormat | pix_fmt, |
enum FFVkShaderRepFormat | rep_fmt | ||
) |
Definition at line 1513 of file vulkan.c.
Referenced by init_decode_shader(), init_encode_shader(), init_filter(), init_rct_shader(), init_setup_shader(), and init_vulkan().
|
static |
Definition at line 1691 of file vulkan.c.
Referenced by ff_vk_create_imageviews().
|
static |
Definition at line 1703 of file vulkan.c.
Referenced by ff_vk_create_imageview(), and ff_vk_create_imageviews().
|
static |
Definition at line 1790 of file vulkan.c.
Referenced by ff_vk_create_imageview(), and ff_vk_create_imageviews().
int ff_vk_create_imageview | ( | FFVulkanContext * | s, |
VkImageView * | img_view, | ||
VkImageAspectFlags * | aspect, | ||
AVFrame * | f, | ||
int | plane, | ||
enum FFVkShaderRepFormat | rep_fmt | ||
) |
Create a single imageview for a given plane.
Definition at line 1813 of file vulkan.c.
Referenced by ff_vk_decode_prepare_frame_sdr().
int ff_vk_create_imageviews | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
VkImageView | views[AV_NUM_DATA_POINTERS], | ||
AVFrame * | f, | ||
enum FFVkShaderRepFormat | rep_fmt | ||
) |
Create an imageview and add it as a dependency to an execution.
Definition at line 1865 of file vulkan.c.
Referenced by ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), run_rct(), vk_ffv1_end_frame(), and vulkan_encode_ffv1_submit_frame().
void ff_vk_frame_barrier | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
AVFrame * | pic, | ||
VkImageMemoryBarrier2 * | bar, | ||
int * | nb_bar, | ||
VkPipelineStageFlags | src_stage, | ||
VkPipelineStageFlags | dst_stage, | ||
VkAccessFlagBits | new_access, | ||
VkImageLayout | new_layout, | ||
uint32_t | new_qf | ||
) |
Definition at line 1949 of file vulkan.c.
Referenced by ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), prepare_frame(), run_rct(), vk_ffv1_end_frame(), vulkan_encode_ffv1_submit_frame(), and vulkan_transfer_frame().
int ff_vk_shader_init | ( | FFVulkanContext * | s, |
FFVulkanShader * | shd, | ||
const char * | name, | ||
VkPipelineStageFlags | stage, | ||
const char * | extensions[], | ||
int | nb_extensions, | ||
int | lg_x, | ||
int | lg_y, | ||
int | lg_z, | ||
uint32_t | required_subgroup_size | ||
) |
Initialize a shader object, with a specific set of extensions, type+bind, local group size, and subgroup requirements.
Definition at line 1992 of file vulkan.c.
Referenced by init_decode_shader(), init_encode_shader(), init_filter(), init_rct_shader(), init_reset_shader(), init_setup_shader(), and init_vulkan().
void ff_vk_shader_print | ( | void * | ctx, |
FFVulkanShader * | shd, | ||
int | prio | ||
) |
Output the shader code as logging data, with a specific priority.
Definition at line 2067 of file vulkan.c.
Referenced by glslc_shader_compile(), and shdc_shader_compile().
|
static |
Definition at line 2089 of file vulkan.c.
Referenced by ff_vk_shader_link().
|
static |
Definition at line 2115 of file vulkan.c.
Referenced by ff_vk_shader_link().
|
static |
Definition at line 2141 of file vulkan.c.
Referenced by ff_vk_shader_link().
|
static |
Definition at line 2176 of file vulkan.c.
Referenced by ff_vk_shader_link().
|
static |
Definition at line 2217 of file vulkan.c.
Referenced by ff_vk_shader_link().
int ff_vk_shader_link | ( | FFVulkanContext * | s, |
FFVulkanShader * | shd, | ||
uint8_t * | spirv, | ||
size_t | spirv_len, | ||
const char * | entrypoint | ||
) |
Link a shader into an executable.
Definition at line 2281 of file vulkan.c.
Referenced by init_decode_shader(), init_encode_shader(), init_filter(), init_gblur_pipeline(), init_rct_shader(), init_reset_shader(), init_setup_shader(), and init_vulkan().
int ff_vk_shader_add_descriptor_set | ( | FFVulkanContext * | s, |
FFVulkanShader * | shd, | ||
FFVulkanDescriptorSetBinding * | desc, | ||
int | nb, | ||
int | singular, | ||
int | print_to_shader_only | ||
) |
Add descriptor to a shader.
Must be called before shader init.
Definition at line 2356 of file vulkan.c.
Referenced by init_decode_shader(), init_encode_shader(), init_filter(), init_gblur_pipeline(), init_rct_shader(), init_reset_shader(), init_setup_shader(), and init_vulkan().
int ff_vk_shader_register_exec | ( | FFVulkanContext * | s, |
FFVkExecPool * | pool, | ||
FFVulkanShader * | shd | ||
) |
Register a shader with an exec pool.
Pool may be NULL if all descriptor sets are read-only.
Definition at line 2489 of file vulkan.c.
Referenced by init_decode_shader(), init_encode_shader(), init_filter(), init_gblur_pipeline(), init_rct_shader(), init_reset_shader(), init_setup_shader(), and init_vulkan().
|
inlinestatic |
Definition at line 2606 of file vulkan.c.
Referenced by ff_vk_exec_bind_shader(), update_set_descriptor(), and update_set_pool_write().
|
inlinestatic |
Definition at line 2615 of file vulkan.c.
Referenced by ff_vk_shader_update_desc_buffer(), and ff_vk_shader_update_img().
|
inlinestatic |
Definition at line 2634 of file vulkan.c.
Referenced by ff_vk_shader_update_desc_buffer(), and ff_vk_shader_update_img().
int ff_vk_shader_update_img | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
FFVulkanShader * | shd, | ||
int | set, | ||
int | bind, | ||
int | offs, | ||
VkImageView | view, | ||
VkImageLayout | layout, | ||
VkSampler | sampler | ||
) |
Sets an image descriptor for specified shader and binding.
Definition at line 2661 of file vulkan.c.
Referenced by ff_vk_shader_update_img_array().
void ff_vk_shader_update_img_array | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
FFVulkanShader * | shd, | ||
AVFrame * | f, | ||
VkImageView * | views, | ||
int | set, | ||
int | binding, | ||
VkImageLayout | layout, | ||
VkSampler | sampler | ||
) |
Update a descriptor in a buffer with an image array.
Must be called before binding the shader.
Definition at line 2726 of file vulkan.c.
Referenced by ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), run_rct(), vk_ffv1_end_frame(), and vulkan_encode_ffv1_submit_frame().
int ff_vk_shader_update_desc_buffer | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
FFVulkanShader * | shd, | ||
int | set, | ||
int | bind, | ||
int | elem, | ||
FFVkBuffer * | buf, | ||
VkDeviceSize | offset, | ||
VkDeviceSize | len, | ||
VkFormat | fmt | ||
) |
Update a descriptor in a buffer with a buffer.
Must be called before binding the shader.
Definition at line 2739 of file vulkan.c.
Referenced by init_gblur_pipeline(), run_rct(), vk_decode_ffv1_init(), vk_ffv1_end_frame(), vulkan_encode_ffv1_init(), and vulkan_encode_ffv1_submit_frame().
void ff_vk_shader_update_push_const | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
FFVulkanShader * | shd, | ||
VkShaderStageFlagBits | stage, | ||
int | offset, | ||
size_t | size, | ||
void * | src | ||
) |
Update push constant in a shader.
Must be called before binding the shader.
Definition at line 2805 of file vulkan.c.
Referenced by ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), run_rct(), vk_ffv1_end_frame(), and vulkan_encode_ffv1_submit_frame().
void ff_vk_exec_bind_shader | ( | FFVulkanContext * | s, |
FFVkExecContext * | e, | ||
FFVulkanShader * | shd | ||
) |
Bind a shader.
Definition at line 2815 of file vulkan.c.
Referenced by ff_vk_filter_process_2pass(), ff_vk_filter_process_Nin(), ff_vk_filter_process_simple(), run_rct(), vk_ffv1_end_frame(), and vulkan_encode_ffv1_submit_frame().
void ff_vk_shader_free | ( | FFVulkanContext * | s, |
FFVulkanShader * | shd | ||
) |
Free a shader.
Definition at line 2849 of file vulkan.c.
Referenced by avgblur_vulkan_uninit(), bwdif_vulkan_uninit(), chromaber_vulkan_uninit(), flip_vulkan_uninit(), gblur_vulkan_uninit(), interlace_vulkan_uninit(), overlay_vulkan_uninit(), scale_vulkan_uninit(), testsrc_vulkan_uninit(), transpose_vulkan_uninit(), uninit(), vk_decode_ffv1_uninit(), and vulkan_encode_ffv1_close().
void ff_vk_uninit | ( | FFVulkanContext * | s | ) |
Frees main context.
Definition at line 2890 of file vulkan.c.
Referenced by avgblur_vulkan_uninit(), bwdif_vulkan_uninit(), chromaber_vulkan_uninit(), ff_vk_init(), ff_vulkan_encode_uninit(), flip_vulkan_uninit(), free_common(), gblur_vulkan_uninit(), interlace_vulkan_uninit(), libplacebo_uninit(), overlay_vulkan_uninit(), scale_vulkan_uninit(), testsrc_vulkan_uninit(), transpose_vulkan_uninit(), uninit(), vulkan_device_uninit(), and vulkan_encode_ffv1_close().
int ff_vk_init | ( | FFVulkanContext * | s, |
void * | log_parent, | ||
AVBufferRef * | device_ref, | ||
AVBufferRef * | frames_ref | ||
) |
Initializes the AVClass, in case this context is not used as the main user's context.
May use either a frames context reference, or a device context reference.
Definition at line 2901 of file vulkan.c.
Referenced by ff_vk_decode_init(), and vulkan_encode_ffv1_init().
const VkComponentMapping ff_comp_identity_map |
Definition at line 27 of file vulkan.c.
Referenced by ff_vk_create_imageview(), ff_vk_create_imageviews(), and ff_vk_video_common_init().
|
static |