FFmpeg
vulkan.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVUTIL_VULKAN_H
20 #define AVUTIL_VULKAN_H
21 
22 #define VK_NO_PROTOTYPES
23 
24 #include <stdatomic.h>
25 
26 #include "pixdesc.h"
27 #include "bprint.h"
28 #include "hwcontext.h"
29 #include "vulkan_functions.h"
30 #include "hwcontext_vulkan.h"
31 
32 /* GLSL management macros */
33 #define INDENT(N) INDENT_##N
34 #define INDENT_0
35 #define INDENT_1 INDENT_0 " "
36 #define INDENT_2 INDENT_1 INDENT_1
37 #define INDENT_3 INDENT_2 INDENT_1
38 #define INDENT_4 INDENT_3 INDENT_1
39 #define INDENT_5 INDENT_4 INDENT_1
40 #define INDENT_6 INDENT_5 INDENT_1
41 #define C(N, S) INDENT(N) #S "\n"
42 
43 #define GLSLC(N, S) \
44  do { \
45  av_bprintf(&shd->src, C(N, S)); \
46  } while (0)
47 
48 #define GLSLA(...) \
49  do { \
50  av_bprintf(&shd->src, __VA_ARGS__); \
51  } while (0)
52 
53 #define GLSLF(N, S, ...) \
54  do { \
55  av_bprintf(&shd->src, C(N, S), __VA_ARGS__); \
56  } while (0)
57 
58 #define GLSLD(D) \
59  do { \
60  av_bprintf(&shd->src, "\n"); \
61  av_bprint_append_data(&shd->src, D, strlen(D)); \
62  av_bprintf(&shd->src, "\n"); \
63  } while (0)
64 
65 /* Helper, pretty much every Vulkan return value needs to be checked */
66 #define RET(x) \
67  do { \
68  if ((err = (x)) < 0) \
69  goto fail; \
70  } while (0)
71 
72 #define DUP_SAMPLER(x) { x, x, x, x }
73 
75  const char *name;
76  VkDescriptorType type;
77  const char *mem_layout; /* Storage images (rgba8, etc.) and buffers (std430, etc.) */
78  const char *mem_quali; /* readonly, writeonly, etc. */
79  const char *buf_content; /* For buffers */
80  uint32_t dimensions; /* Needed for e.g. sampler%iD */
81  uint32_t elems; /* 0 - scalar, 1 or more - vector */
82  VkShaderStageFlags stages;
83  uint32_t buf_elems; /* Appends [buf_elems] to the contents. Avoids manually printing to a string. */
84  VkSampler samplers[4]; /* Sampler to use for all elems */
86 
87 typedef struct FFVkBuffer {
88  VkBuffer buf;
89  VkDeviceMemory mem;
90  VkMemoryPropertyFlagBits flags;
91  size_t size;
92  VkDeviceAddress address;
93 
94  /* Only valid when allocated via ff_vk_get_pooled_buffer with HOST_VISIBLE or
95  * via ff_vk_host_map_buffer */
96  uint8_t *mapped_mem;
97 
98  /* Set by ff_vk_host_map_buffer. This is the offset at which the buffer data
99  * actually begins at.
100  * The address and mapped_mem fields will be offset by this amount. */
102 
103  /* If host mapping, reference to the backing host memory buffer */
105 } FFVkBuffer;
106 
107 typedef struct FFVkExecContext {
108  uint32_t idx;
109  const struct FFVkExecPool *parent;
111 
112  /* Queue for the execution context */
113  VkQueue queue;
114  int qf;
115  int qi;
116 
117  /* Command buffer for the context */
118  VkCommandBuffer buf;
119 
120  /* Fence for the command buffer */
121  VkFence fence;
122 
123  /* Opaque data, untouched, free to use by users */
124  void *opaque;
125 
126  void *query_data;
128 
129  /* Buffer dependencies */
132  unsigned int buf_deps_alloc_size;
133 
134  /* Frame dependencies */
136  unsigned int frame_deps_alloc_size;
138 
139  /* Software frame dependencies */
143 
144  VkSemaphoreSubmitInfo *sem_wait;
145  unsigned int sem_wait_alloc;
147 
148  VkSemaphoreSubmitInfo *sem_sig;
149  unsigned int sem_sig_alloc;
151 
152  uint64_t **sem_sig_val_dst;
153  unsigned int sem_sig_val_dst_alloc;
155 
156  uint8_t *frame_locked;
158 
159  VkAccessFlagBits *access_dst;
160  unsigned int access_dst_alloc;
161 
162  VkImageLayout *layout_dst;
163  unsigned int layout_dst_alloc;
164 
165  uint32_t *queue_family_dst;
167 
168  uint8_t *frame_update;
171 
172 typedef struct FFVulkanDescriptorSet {
173  /* Descriptor buffer */
174  VkDeviceSize layout_size;
175  VkDeviceSize aligned_size; /* descriptorBufferOffsetAlignment */
176  VkBufferUsageFlags usage;
177 
178  VkDescriptorSetLayoutBinding *binding;
179  VkDeviceSize *binding_offset;
181 
182  /* Descriptor set is shared between all submissions */
183  int singular;
185 
186 typedef struct FFVulkanShader {
187  /* Name for id/debugging purposes */
188  const char *name;
189 
190  /* Shader text */
191  AVBPrint src;
192 
193  /* Compute shader local group sizes */
194  int lg_size[3];
195 
196  /* Shader bind point/type */
197  VkPipelineStageFlags stage;
198  VkPipelineBindPoint bind_point;
199 
200  /* Creation info */
201  VkPipelineShaderStageRequiredSubgroupSizeCreateInfo subgroup_info;
202 
203  /* Base shader object */
204  VkShaderEXT object;
205  VkPipeline pipeline;
206 
207  /* Pipeline layout */
208  VkPipelineLayout pipeline_layout;
209 
210  /* Push consts */
211  VkPushConstantRange *push_consts;
213 
214  /* Descriptor sets */
217 
218  /* Descriptor buffer */
219  VkDescriptorSetLayout *desc_layout;
221 
222  /* Descriptor pool */
223  int use_push;
224  VkDescriptorPoolSize *desc_pool_size;
227 
229  /* Descriptor buffer */
231  uint8_t *desc_mem;
233 
234 typedef struct FFVulkanShaderData {
235  /* Shader to which this data belongs to */
238 
239  /* Descriptor buffer */
241  VkDescriptorBufferBindingInfoEXT *desc_bind;
242 
243  /* Descriptor pools */
244  VkDescriptorSet *desc_sets;
245  VkDescriptorPool desc_pool;
247 
248 typedef struct FFVkExecPool {
251 
252  VkCommandPool *cmd_buf_pools;
253  VkCommandBuffer *cmd_bufs;
255 
256  VkQueryPool query_pool;
257  void *query_data;
263  size_t qd_size;
264 
265  /* Registered shaders' data */
268 } FFVkExecPool;
269 
270 typedef struct FFVulkanContext {
271  const AVClass *class;
272  void *log_parent;
273 
276  VkPhysicalDeviceProperties2 props;
277  VkPhysicalDeviceVulkan11Properties props_11;
278  VkPhysicalDeviceDriverProperties driver_props;
279  VkPhysicalDeviceMemoryProperties mprops;
280  VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops;
281  VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props;
282  VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props;
283  VkPhysicalDeviceCooperativeMatrixPropertiesKHR coop_matrix_props;
284  VkPhysicalDevicePushDescriptorPropertiesKHR push_desc_props;
285  VkPhysicalDeviceOpticalFlowPropertiesNV optical_flow_props;
286  VkQueueFamilyQueryResultStatusPropertiesKHR *query_props;
287  VkQueueFamilyVideoPropertiesKHR *video_props;
288  VkQueueFamilyProperties2 *qf_props;
290  VkPhysicalDeviceHostImageCopyPropertiesEXT host_image_props;
291  VkImageLayout *host_image_copy_layouts;
292 
293  VkCooperativeMatrixPropertiesKHR *coop_mat_props;
295 
296  VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_feats;
297  VkPhysicalDeviceVulkan12Features feats_12;
298  VkPhysicalDeviceFeatures2 feats;
299 
300  VkMemoryPropertyFlagBits host_cached_flag;
301 
305 
310 
311  uint32_t qfs[64];
312  int nb_qfs;
313 
314  /* Properties */
320 
321 static inline int ff_vk_count_images(AVVkFrame *f)
322 {
323  int cnt = 0;
324  while (cnt < FF_ARRAY_ELEMS(f->img) && f->img[cnt])
325  cnt++;
326 
327  return cnt;
328 }
329 
330 static inline const void *ff_vk_find_struct(const void *chain, VkStructureType stype)
331 {
332  const VkBaseInStructure *in = chain;
333  while (in) {
334  if (in->sType == stype)
335  return in;
336 
337  in = in->pNext;
338  }
339 
340  return NULL;
341 }
342 
343 static inline void ff_vk_link_struct(void *chain, const void *in)
344 {
345  VkBaseOutStructure *out = chain;
346  while (out->pNext)
347  out = out->pNext;
348 
349  out->pNext = (void *)in;
350 }
351 
352 #define FF_VK_STRUCT_EXT(CTX, BASE, STRUCT_P, EXT_FLAG, TYPE) \
353  do { \
354  if ((EXT_FLAG == FF_VK_EXT_NO_FLAG) || \
355  ((CTX)->extensions & EXT_FLAG)) { \
356  (STRUCT_P)->sType = TYPE; \
357  ff_vk_link_struct(BASE, STRUCT_P); \
358  } \
359  } while (0)
360 
361 /* Identity mapping - r = r, b = b, g = g, a = a */
362 extern const VkComponentMapping ff_comp_identity_map;
363 
364 /**
365  * Initializes the AVClass, in case this context is not used
366  * as the main user's context.
367  * May use either a frames context reference, or a device context reference.
368  */
369 int ff_vk_init(FFVulkanContext *s, void *log_parent,
370  AVBufferRef *device_ref, AVBufferRef *frames_ref);
371 
372 /**
373  * Converts Vulkan return values to strings
374  */
375 const char *ff_vk_ret2str(VkResult res);
376 
377 /**
378  * Map between usage and features.
379  */
380 VkImageUsageFlags ff_vk_map_feats_to_usage(VkFormatFeatureFlagBits2 feats);
381 VkFormatFeatureFlagBits2 ff_vk_map_usage_to_feats(VkImageUsageFlags usage);
382 
383 /**
384  * Returns 1 if pixfmt is a usable RGB format.
385  */
387 
388 /**
389  * Since storage images may not be swizzled, we have to do this in the
390  * shader itself. This fills in a lookup table to do it.
391  */
392 void ff_vk_set_perm(enum AVPixelFormat pix_fmt, int lut[4], int inv);
393 
394 /**
395  * Get the aspect flag for a plane from an image.
396  */
397 VkImageAspectFlags ff_vk_aspect_flag(AVFrame *f, int p);
398 
399 /**
400  * Returns the format to use for images in shaders.
401  */
403  /* Native format with no conversion. May require casting. */
405  /* Float conversion of the native format. */
407  /* Signed integer version of the native format */
409  /* Unsigned integer version of the native format */
411 };
413  enum FFVkShaderRepFormat rep_fmt);
414 
415 /**
416  * Loads props/mprops/driver_props
417  */
419 
420 /**
421  * Chooses an appropriate QF.
422  */
424  VkQueueFlagBits dev_family,
425  VkVideoCodecOperationFlagBitsKHR vid_ops);
426 
427 /**
428  * Allocates/frees an execution pool.
429  * If used in a multi-threaded context, there must be at least as many contexts
430  * as there are threads.
431  * ff_vk_exec_pool_init_desc() MUST be called if ff_vk_exec_descriptor_set_add()
432  * has been called.
433  */
435  FFVkExecPool *pool, int nb_contexts,
436  int nb_queries, VkQueryType query_type, int query_64bit,
437  const void *query_create_pnext);
439 
440 /**
441  * Retrieve an execution pool. Threadsafe.
442  */
444 
445 /**
446  * Performs nb_queries queries and returns their results and statuses.
447  * 64_BIT and WITH_STATUS flags are ignored as 64_BIT must be specified via
448  * query_64bit in ff_vk_exec_pool_init() and WITH_STATUS is always enabled.
449  */
451  void **data, VkQueryResultFlagBits flags);
452 
453 /**
454  * Start/submit/wait an execution.
455  * ff_vk_exec_start() always waits on a submission, so using ff_vk_exec_wait()
456  * is not necessary (unless using it is just better).
457  */
461 
462 /**
463  * Execution dependency management.
464  * Can attach buffers to executions that will only be unref'd once the
465  * buffer has finished executing.
466  * Adding a frame dep will *lock the frame*, until either the dependencies
467  * are discarded, the execution is submitted, or a failure happens.
468  * update_frame will update the frame's properties before it is unlocked,
469  * only if submission was successful.
470  */
472  AVBufferRef **deps, int nb_deps, int ref);
474  VkSemaphore sem, uint64_t val,
475  VkPipelineStageFlagBits2 stage);
477  VkSemaphore *sem, int nb,
478  VkPipelineStageFlagBits2 stage,
479  int wait); /* Ownership transferred if !wait */
481  VkPipelineStageFlagBits2 wait_stage,
482  VkPipelineStageFlagBits2 signal_stage);
484  AVFrame *f);
486  VkImageMemoryBarrier2 *bar, uint32_t *nb_img_bar);
488  VkSemaphore *dst, uint64_t *dst_val,
489  AVFrame *f);
491 
492 /**
493  * Create a single imageview for a given plane.
494  */
496  VkImageView *img_view, VkImageAspectFlags *aspect,
497  AVFrame *f, int plane, enum FFVkShaderRepFormat rep_fmt);
498 
499 /**
500  * Create an imageview and add it as a dependency to an execution.
501  */
503  VkImageView views[AV_NUM_DATA_POINTERS],
504  AVFrame *f, enum FFVkShaderRepFormat rep_fmt);
505 
506 #define ff_vk_buf_barrier(dst, vkb, s_stage, s_access, s_access2, \
507  d_stage, d_access, d_access2, offs, bsz) \
508  do { \
509  dst = (VkBufferMemoryBarrier2) { \
510  .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, \
511  .srcStageMask = VK_PIPELINE_STAGE_2_ ##s_stage, \
512  .srcAccessMask = VK_ACCESS_2_ ##s_access | \
513  VK_ACCESS_2_ ##s_access2, \
514  .dstStageMask = VK_PIPELINE_STAGE_2_ ##d_stage, \
515  .dstAccessMask = VK_ACCESS_2_ ##d_access | \
516  VK_ACCESS_2_ ##d_access2, \
517  .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, \
518  .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, \
519  .buffer = vkb->buf, \
520  .offset = offs, \
521  .size = bsz \
522  }; \
523  } while(0)
524 
526  AVFrame *pic, VkImageMemoryBarrier2 *bar, int *nb_bar,
527  VkPipelineStageFlags2 src_stage,
528  VkPipelineStageFlags2 dst_stage,
529  VkAccessFlagBits2 new_access,
530  VkImageLayout new_layout,
531  uint32_t new_qf);
532 
533 /**
534  * Memory/buffer/image allocation helpers.
535  */
536 int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
537  VkMemoryPropertyFlagBits req_flags, void *alloc_extension,
538  VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem);
540  void *pNext, void *alloc_pNext,
541  VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags);
542 
543 /**
544  * Flush or invalidate a single buffer, with a given size and offset.
545  */
547  VkDeviceSize offset, VkDeviceSize mem_size,
548  int flush);
549 
550 /**
551  * Buffer management code.
552  */
553 int ff_vk_map_buffers(FFVulkanContext *s, FFVkBuffer **buf, uint8_t *mem[],
554  int nb_buffers, int invalidate);
555 int ff_vk_unmap_buffers(FFVulkanContext *s, FFVkBuffer **buf, int nb_buffers,
556  int flush);
557 
558 static inline int ff_vk_map_buffer(FFVulkanContext *s, FFVkBuffer *buf, uint8_t **mem,
559  int invalidate)
560 {
561  return ff_vk_map_buffers(s, (FFVkBuffer *[]){ buf }, mem,
562  1, invalidate);
563 }
564 
565 static inline int ff_vk_unmap_buffer(FFVulkanContext *s, FFVkBuffer *buf, int flush)
566 {
567  return ff_vk_unmap_buffers(s, (FFVkBuffer *[]){ buf }, 1, flush);
568 }
569 
571 
572 /** Initialize a pool and create AVBufferRefs containing FFVkBuffer.
573  * Threadsafe to use. Buffers are automatically mapped on creation if
574  * VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is set in mem_props. Users should
575  * synchronize access themselvesd. Mainly meant for device-local buffers. */
577  AVBufferRef **buf, VkBufferUsageFlags usage,
578  void *create_pNext, size_t size,
579  VkMemoryPropertyFlagBits mem_props);
580 
581 /** Maps a system RAM buffer into a Vulkan buffer.
582  * References the source buffer.
583  */
585  uint8_t *src_data, const AVBufferRef *src_buf,
586  VkBufferUsageFlags usage);
587 
588 /**
589  * Create a sampler.
590  */
591 int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler,
592  int unnorm_coords, VkFilter filt);
593 
594 /**
595  * Initialize a shader object, with a specific set of extensions, type+bind,
596  * local group size, and subgroup requirements.
597  */
598 int ff_vk_shader_init(FFVulkanContext *s, FFVulkanShader *shd, const char *name,
599  VkPipelineStageFlags stage,
600  const char *extensions[], int nb_extensions,
601  int lg_x, int lg_y, int lg_z,
602  uint32_t required_subgroup_size);
603 
604 /**
605  * Output the shader code as logging data, with a specific
606  * priority.
607  */
608 void ff_vk_shader_print(void *ctx, FFVulkanShader *shd, int prio);
609 
610 /**
611  * Link a shader into an executable.
612  */
614  uint8_t *spirv, size_t spirv_len,
615  const char *entrypoint);
616 
617 /**
618  * Add/update push constants for execution.
619  */
621  VkShaderStageFlagBits stage);
622 
623 /**
624  * Add descriptor to a shader. Must be called before shader init.
625  */
628  int singular, int print_to_shader_only);
629 
630 /**
631  * Register a shader with an exec pool.
632  * Pool may be NULL if all descriptor sets are read-only.
633  */
635  FFVulkanShader *shd);
636 
637 /**
638  * Bind a shader.
639  */
641  FFVulkanShader *shd);
642 
643 /**
644  * Update push constant in a shader.
645  * Must be called before binding the shader.
646  */
648  FFVulkanShader *shd,
649  VkShaderStageFlagBits stage,
650  int offset, size_t size, void *src);
651 
652 /**
653  * Update a descriptor in a buffer with a buffer.
654  * Must be called before binding the shader.
655  */
657  FFVulkanShader *shd,
658  int set, int bind, int elem,
659  FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize len,
660  VkFormat fmt);
661 
662 /**
663  * Sets an image descriptor for specified shader and binding.
664  */
666  FFVulkanShader *shd, int set, int bind, int offs,
667  VkImageView view, VkImageLayout layout,
668  VkSampler sampler);
669 
670 /**
671  * Update a descriptor in a buffer with an image array..
672  * Must be called before binding the shader.
673  */
675  FFVulkanShader *shd, AVFrame *f,
676  VkImageView *views, int set, int binding,
677  VkImageLayout layout, VkSampler sampler);
678 
679 /**
680  * Free a shader.
681  */
683 
684 /**
685  * Frees main context.
686  */
688 
689 #endif /* AVUTIL_VULKAN_H */
FFVulkanShader::bind_point
VkPipelineBindPoint bind_point
Definition: vulkan.h:198
flags
const SwsFlags flags[]
Definition: swscale.c:61
ff_vk_ret2str
const char * ff_vk_ret2str(VkResult res)
Converts Vulkan return values to strings.
Definition: vulkan.c:35
ff_vk_exec_add_dep_bool_sem
int ff_vk_exec_add_dep_bool_sem(FFVulkanContext *s, FFVkExecContext *e, VkSemaphore *sem, int nb, VkPipelineStageFlagBits2 stage, int wait)
Definition: vulkan.c:717
ff_vk_map_buffers
int ff_vk_map_buffers(FFVulkanContext *s, FFVkBuffer **buf, uint8_t *mem[], int nb_buffers, int invalidate)
Buffer management code.
Definition: vulkan.c:1127
ff_vk_unmap_buffers
int ff_vk_unmap_buffers(FFVulkanContext *s, FFVkBuffer **buf, int nb_buffers, int flush)
Definition: vulkan.c:1205
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
ff_vk_exec_discard_deps
void ff_vk_exec_discard_deps(FFVulkanContext *s, FFVkExecContext *e)
Definition: vulkan.c:595
ff_vk_map_usage_to_feats
VkFormatFeatureFlagBits2 ff_vk_map_usage_to_feats(VkImageUsageFlags usage)
FFVulkanContext::hwfc
AVVulkanFramesContext * hwfc
Definition: vulkan.h:309
ff_vk_uninit
void ff_vk_uninit(FFVulkanContext *s)
Frees main context.
Definition: vulkan.c:3004
ff_vk_exec_add_dep_frame
int ff_vk_exec_add_dep_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, VkPipelineStageFlagBits2 wait_stage, VkPipelineStageFlagBits2 signal_stage)
Definition: vulkan.c:783
FFVulkanContext::output_height
int output_height
Definition: vulkan.h:316
FFVulkanContext::props_11
VkPhysicalDeviceVulkan11Properties props_11
Definition: vulkan.h:277
FFVkExecContext::frame_deps_alloc_size
unsigned int frame_deps_alloc_size
Definition: vulkan.h:136
out
FILE * out
Definition: movenc.c:55
FFVulkanExtensions
uint64_t FFVulkanExtensions
Definition: vulkan_functions.h:29
AVBufferPool
The buffer pool.
Definition: buffer_internal.h:88
ff_vk_load_props
int ff_vk_load_props(FFVulkanContext *s)
Loads props/mprops/driver_props.
Definition: vulkan.c:142
ff_vk_exec_pool_init
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.
Definition: vulkan.c:360
ff_vk_exec_add_dep_sw_frame
int ff_vk_exec_add_dep_sw_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f)
Definition: vulkan.c:650
FFVulkanContext::device_ref
AVBufferRef * device_ref
Definition: vulkan.h:302
FFVkExecPool::contexts
FFVkExecContext * contexts
Definition: vulkan.h:249
FFVkExecPool::idx
atomic_uint_least64_t idx
Definition: vulkan.h:250
FFVulkanDescriptorSetData
Definition: vulkan.h:228
FFVulkanShader::nb_desc_pool_size
int nb_desc_pool_size
Definition: vulkan.h:225
FFVulkanShaderData
Definition: vulkan.h:234
FFVkExecContext::qf
int qf
Definition: vulkan.h:114
FFVulkanDescriptorSet::aligned_size
VkDeviceSize aligned_size
Definition: vulkan.h:175
FFVulkanShaderData::shd
FFVulkanShader * shd
Definition: vulkan.h:236
ff_vk_init
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.
Definition: vulkan.c:3016
FFVkBuffer::host_ref
AVBufferRef * host_ref
Definition: vulkan.h:104
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
pixdesc.h
FFVulkanDescriptorSetBinding::stages
VkShaderStageFlags stages
Definition: vulkan.h:82
ff_vk_map_buffer
static int ff_vk_map_buffer(FFVulkanContext *s, FFVkBuffer *buf, uint8_t **mem, int invalidate)
Definition: vulkan.h:558
FFVulkanShader::subgroup_info
VkPipelineShaderStageRequiredSubgroupSizeCreateInfo subgroup_info
Definition: vulkan.h:201
ff_vk_find_struct
static const void * ff_vk_find_struct(const void *chain, VkStructureType stype)
Definition: vulkan.h:330
FFVulkanShader::pipeline
VkPipeline pipeline
Definition: vulkan.h:205
FFVkExecContext::sem_sig_alloc
unsigned int sem_sig_alloc
Definition: vulkan.h:149
FFVulkanShaderData::desc_bind
VkDescriptorBufferBindingInfoEXT * desc_bind
Definition: vulkan.h:241
FFVulkanShader::src
AVBPrint src
Definition: vulkan.h:191
FFVulkanShader::use_push
int use_push
Definition: vulkan.h:223
ff_vk_exec_add_dep_wait_sem
int ff_vk_exec_add_dep_wait_sem(FFVulkanContext *s, FFVkExecContext *e, VkSemaphore sem, uint64_t val, VkPipelineStageFlagBits2 stage)
Definition: vulkan.c:700
data
const char data[16]
Definition: mxf.c:149
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: vulkan.c:2392
FFVkBuffer::address
VkDeviceAddress address
Definition: vulkan.h:92
FFVkExecContext::sem_wait
VkSemaphoreSubmitInfo * sem_wait
Definition: vulkan.h:144
FF_VK_REP_NATIVE
@ FF_VK_REP_NATIVE
Definition: vulkan.h:404
FF_VK_REP_INT
@ FF_VK_REP_INT
Definition: vulkan.h:408
FFVulkanDescriptorSetBinding::buf_content
const char * buf_content
Definition: vulkan.h:79
ff_vk_shader_print
void ff_vk_shader_print(void *ctx, FFVulkanShader *shd, int prio)
Output the shader code as logging data, with a specific priority.
Definition: vulkan.c:2177
FFVkExecPool::query_pool
VkQueryPool query_pool
Definition: vulkan.h:256
FFVkExecPool::nb_reg_shd
int nb_reg_shd
Definition: vulkan.h:267
FFVulkanDescriptorSetData::desc_mem
uint8_t * desc_mem
Definition: vulkan.h:231
ff_vk_shader_add_descriptor_set
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.
Definition: vulkan.c:2467
FFVkExecContext::nb_sw_frame_deps
int nb_sw_frame_deps
Definition: vulkan.h:142
FFVulkanShaderData::desc_sets
VkDescriptorSet * desc_sets
Definition: vulkan.h:244
FFVulkanContext::tot_nb_qfs
int tot_nb_qfs
Definition: vulkan.h:289
FFVkShaderRepFormat
FFVkShaderRepFormat
Returns the format to use for images in shaders.
Definition: vulkan.h:402
FFVkBuffer::buf
VkBuffer buf
Definition: vulkan.h:88
ff_vk_shader_free
void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
Free a shader.
Definition: vulkan.c:2963
FFVkExecContext::frame_update_alloc_size
unsigned int frame_update_alloc_size
Definition: vulkan.h:169
FFVulkanShader::desc_layout
VkDescriptorSetLayout * desc_layout
Definition: vulkan.h:219
ff_vk_shader_register_exec
int ff_vk_shader_register_exec(FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd)
Register a shader with an exec pool.
Definition: vulkan.c:2603
ff_vk_shader_rep_fmt
const char * ff_vk_shader_rep_fmt(enum AVPixelFormat pix_fmt, enum FFVkShaderRepFormat rep_fmt)
Definition: vulkan.c:1628
ff_vk_flush_buffer
int ff_vk_flush_buffer(FFVulkanContext *s, FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize mem_size, int flush)
Flush or invalidate a single buffer, with a given size and offset.
Definition: vulkan.c:1174
FFVulkanDescriptorSet::nb_bindings
int nb_bindings
Definition: vulkan.h:180
FFVulkanContext::feats
VkPhysicalDeviceFeatures2 feats
Definition: vulkan.h:298
ff_vk_exec_mirror_sem_value
int ff_vk_exec_mirror_sem_value(FFVulkanContext *s, FFVkExecContext *e, VkSemaphore *dst, uint64_t *dst_val, AVFrame *f)
Definition: vulkan.c:882
FFVulkanDescriptorSet::layout_size
VkDeviceSize layout_size
Definition: vulkan.h:174
AVVulkanFramesContext
Allocated as AVHWFramesContext.hwctx, used to set pool-specific options.
Definition: hwcontext_vulkan.h:212
FFVkExecPool::query_64bit
int query_64bit
Definition: vulkan.h:260
FFVulkanContext::subgroup_props
VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props
Definition: vulkan.h:282
val
static double val(void *priv, double ch)
Definition: aeval.c:77
FFVulkanContext::frames_ref
AVBufferRef * frames_ref
Definition: vulkan.h:307
FFVulkanContext::atomic_float_feats
VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_feats
Definition: vulkan.h:296
FFVkExecPool::query_statuses
int query_statuses
Definition: vulkan.h:259
AVHWDeviceContext
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition: hwcontext.h:63
FFVulkanDescriptorSet::binding
VkDescriptorSetLayoutBinding * binding
Definition: vulkan.h:178
FFVulkanDescriptorSetBinding::type
VkDescriptorType type
Definition: vulkan.h:76
ff_vk_exec_get_query
VkResult ff_vk_exec_get_query(FFVulkanContext *s, FFVkExecContext *e, void **data, VkQueryResultFlagBits flags)
Performs nb_queries queries and returns their results and statuses.
Definition: vulkan.c:523
FFVulkanDescriptorSetData::buf
FFVkBuffer buf
Definition: vulkan.h:230
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
FFVulkanDescriptorSetBinding::samplers
VkSampler samplers[4]
Definition: vulkan.h:84
FFVkExecContext::frame_deps
AVFrame ** frame_deps
Definition: vulkan.h:135
ff_vk_link_struct
static void ff_vk_link_struct(void *chain, const void *in)
Definition: vulkan.h:343
set
static void set(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f, double v)
Definition: swresample.c:57
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.
Definition: vulkan.c:1394
FFVkExecContext::queue_family_dst
uint32_t * queue_family_dst
Definition: vulkan.h:165
FFVulkanDescriptorSetBinding::elems
uint32_t elems
Definition: vulkan.h:81
FFVulkanContext::output_width
int output_width
Definition: vulkan.h:315
ff_vk_shader_update_desc_buffer
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.
Definition: vulkan.c:2853
FFVulkanShader::push_consts
VkPushConstantRange * push_consts
Definition: vulkan.h:211
s
#define s(width, name)
Definition: cbs_vp9.c:198
FFVulkanContext::log_parent
void * log_parent
Definition: vulkan.h:272
FFVulkanContext::driver_props
VkPhysicalDeviceDriverProperties driver_props
Definition: vulkan.h:278
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
FFVkExecContext::fence
VkFence fence
Definition: vulkan.h:121
ff_vk_free_buf
void ff_vk_free_buf(FFVulkanContext *s, FFVkBuffer *buf)
Definition: vulkan.c:1247
FFVulkanContext::host_cached_flag
VkMemoryPropertyFlagBits host_cached_flag
Definition: vulkan.h:300
FF_VK_REP_FLOAT
@ FF_VK_REP_FLOAT
Definition: vulkan.h:406
FFVkExecContext::nb_buf_deps
int nb_buf_deps
Definition: vulkan.h:131
FFVulkanShader::stage
VkPipelineStageFlags stage
Definition: vulkan.h:197
ctx
AVFormatContext * ctx
Definition: movenc.c:49
ff_vk_create_buf
int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, void *pNext, void *alloc_pNext, VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags)
Definition: vulkan.c:1025
FFVulkanDescriptorSetBinding::mem_layout
const char * mem_layout
Definition: vulkan.h:77
FFVkExecContext::frame_update
uint8_t * frame_update
Definition: vulkan.h:168
FFVkExecContext::query_idx
int query_idx
Definition: vulkan.h:127
FFVkExecPool::query_status_stride
int query_status_stride
Definition: vulkan.h:261
FFVkExecContext::parent
const struct FFVkExecPool * parent
Definition: vulkan.h:109
ff_vk_shader_update_push_const
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.
Definition: vulkan.c:2919
AVVulkanDeviceContext
Main Vulkan context, allocated as AVHWDeviceContext.hwctx.
Definition: hwcontext_vulkan.h:59
FFVulkanShaderData::desc_set_buf
FFVulkanDescriptorSetData * desc_set_buf
Definition: vulkan.h:240
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
FFVkExecContext::sw_frame_deps_alloc_size
unsigned int sw_frame_deps_alloc_size
Definition: vulkan.h:141
FFVkExecContext::sem_sig_val_dst_alloc
unsigned int sem_sig_val_dst_alloc
Definition: vulkan.h:153
NULL
#define NULL
Definition: coverity.c:32
FFVulkanDescriptorSetBinding::buf_elems
uint32_t buf_elems
Definition: vulkan.h:83
ff_vk_create_imageviews
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: vulkan.c:1969
ff_vk_frame_barrier
void ff_vk_frame_barrier(FFVulkanContext *s, FFVkExecContext *e, AVFrame *pic, VkImageMemoryBarrier2 *bar, int *nb_bar, VkPipelineStageFlags2 src_stage, VkPipelineStageFlags2 dst_stage, VkAccessFlagBits2 new_access, VkImageLayout new_layout, uint32_t new_qf)
Definition: vulkan.c:2052
FFVkExecContext::access_dst_alloc
unsigned int access_dst_alloc
Definition: vulkan.h:160
FFVulkanDescriptorSet::singular
int singular
Definition: vulkan.h:183
FFVkExecContext::sem_sig_cnt
int sem_sig_cnt
Definition: vulkan.h:150
FFVulkanDescriptorSetBinding::dimensions
uint32_t dimensions
Definition: vulkan.h:80
FFVulkanContext::coop_matrix_props
VkPhysicalDeviceCooperativeMatrixPropertiesKHR coop_matrix_props
Definition: vulkan.h:283
FFVulkanContext::qf_props
VkQueueFamilyProperties2 * qf_props
Definition: vulkan.h:288
hwcontext_vulkan.h
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:552
FFVkExecContext::qi
int qi
Definition: vulkan.h:115
FFVkExecContext::had_submission
int had_submission
Definition: vulkan.h:110
FFVkBuffer::size
size_t size
Definition: vulkan.h:91
FFVkExecPool::nb_queries
int nb_queries
Definition: vulkan.h:262
FFVkBuffer::mapped_mem
uint8_t * mapped_mem
Definition: vulkan.h:96
FFVulkanContext
Definition: vulkan.h:270
FFVulkanShader::nb_descriptor_sets
int nb_descriptor_sets
Definition: vulkan.h:216
FFVulkanShader::bound_buffer_indices
uint32_t * bound_buffer_indices
Definition: vulkan.h:220
ff_vk_init_sampler
int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler, int unnorm_coords, VkFilter filt)
Create a sampler.
Definition: vulkan.c:1513
FFVkExecContext::query_data
void * query_data
Definition: vulkan.h:126
ff_vk_shader_add_push_const
int ff_vk_shader_add_push_const(FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage)
Add/update push constants for execution.
Definition: vulkan.c:1492
ff_vk_exec_wait
void ff_vk_exec_wait(FFVulkanContext *s, FFVkExecContext *e)
Definition: vulkan.c:556
FFVulkanContext::device
AVHWDeviceContext * device
Definition: vulkan.h:303
usage
const char * usage
Definition: floatimg_cmp.c:62
f
f
Definition: af_crystalizer.c:122
FFVkExecContext::layout_dst
VkImageLayout * layout_dst
Definition: vulkan.h:162
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.
Definition: vulkan.c:1289
FFVkExecContext::queue_family_dst_alloc
unsigned int queue_family_dst_alloc
Definition: vulkan.h:166
FFVulkanDescriptorSetBinding
Definition: vulkan.h:74
ff_vk_exec_start
int ff_vk_exec_start(FFVulkanContext *s, FFVkExecContext *e)
Start/submit/wait an execution.
Definition: vulkan.c:563
FFVulkanShaderData::nb_descriptor_sets
int nb_descriptor_sets
Definition: vulkan.h:237
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
AVVkFrame
Definition: hwcontext_vulkan.h:302
FFVulkanContext::host_image_props
VkPhysicalDeviceHostImageCopyPropertiesEXT host_image_props
Definition: vulkan.h:290
size
int size
Definition: twinvq_data.h:10344
FFVulkanShader::desc_pool_size
VkDescriptorPoolSize * desc_pool_size
Definition: vulkan.h:224
AV_NUM_DATA_POINTERS
#define AV_NUM_DATA_POINTERS
Definition: frame.h:428
FFVkExecContext::nb_frame_deps
int nb_frame_deps
Definition: vulkan.h:137
FFVulkanShader
Definition: vulkan.h:186
ff_vk_create_imageview
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: vulkan.c:1918
FFVulkanShader::pipeline_layout
VkPipelineLayout pipeline_layout
Definition: vulkan.h:208
FFVkExecContext::sem_sig_val_dst_cnt
int sem_sig_val_dst_cnt
Definition: vulkan.h:154
FFVulkanContext::output_format
enum AVPixelFormat output_format
Definition: vulkan.h:317
FFVkBuffer::flags
VkMemoryPropertyFlagBits flags
Definition: vulkan.h:90
ff_vk_aspect_flag
VkImageAspectFlags ff_vk_aspect_flag(AVFrame *f, int p)
Get the aspect flag for a plane from an image.
Definition: vulkan.c:1545
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
FFVkExecContext
Definition: vulkan.h:107
FFVulkanDescriptorSetBinding::name
const char * name
Definition: vulkan.h:75
ff_vk_exec_add_dep_buf
int ff_vk_exec_add_dep_buf(FFVulkanContext *s, FFVkExecContext *e, AVBufferRef **deps, int nb_deps, int ref)
Execution dependency management.
Definition: vulkan.c:623
ff_vk_exec_bind_shader
void ff_vk_exec_bind_shader(FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd)
Bind a shader.
Definition: vulkan.c:2929
FFVulkanContext::input_frames_ref
AVBufferRef * input_frames_ref
Definition: vulkan.h:306
FFVkExecContext::sem_wait_cnt
int sem_wait_cnt
Definition: vulkan.h:146
layout
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
Definition: filter_design.txt:18
FFVkExecContext::queue
VkQueue queue
Definition: vulkan.h:113
FFVulkanContext::qfs
uint32_t qfs[64]
Definition: vulkan.h:311
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: vulkan.c:2775
ff_vk_exec_submit
int ff_vk_exec_submit(FFVulkanContext *s, FFVkExecContext *e)
Definition: vulkan.c:908
bprint.h
FFVkExecPool::cmd_buf_pools
VkCommandPool * cmd_buf_pools
Definition: vulkan.h:252
FF_VK_REP_UINT
@ FF_VK_REP_UINT
Definition: vulkan.h:410
FFVulkanShaderData::desc_pool
VkDescriptorPool desc_pool
Definition: vulkan.h:245
VkFormat
enum VkFormat VkFormat
Definition: hwcontext_stub.c:25
FFVulkanShader::push_consts_num
int push_consts_num
Definition: vulkan.h:212
FFVkExecContext::layout_dst_alloc
unsigned int layout_dst_alloc
Definition: vulkan.h:163
ff_vk_exec_get
FFVkExecContext * ff_vk_exec_get(FFVulkanContext *s, FFVkExecPool *pool)
Retrieve an execution pool.
Definition: vulkan.c:551
ff_vk_mt_is_np_rgb
int ff_vk_mt_is_np_rgb(enum AVPixelFormat pix_fmt)
Returns 1 if pixfmt is a usable RGB format.
Definition: vulkan.c:1562
FFVkExecPool::reg_shd
FFVulkanShaderData * reg_shd
Definition: vulkan.h:266
ff_vk_unmap_buffer
static int ff_vk_unmap_buffer(FFVulkanContext *s, FFVkBuffer *buf, int flush)
Definition: vulkan.h:565
FFVkBuffer::mem
VkDeviceMemory mem
Definition: vulkan.h:89
ff_vk_shader_init
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,...
Definition: vulkan.c:2095
ff_vk_qf_find
AVVulkanDeviceQueueFamily * ff_vk_qf_find(FFVulkanContext *s, VkQueueFlagBits dev_family, VkVideoCodecOperationFlagBitsKHR vid_ops)
Chooses an appropriate QF.
Definition: vulkan.c:278
FFVulkanContext::hprops
VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops
Definition: vulkan.h:280
FFVulkanContext::props
VkPhysicalDeviceProperties2 props
Definition: vulkan.h:276
FFVkExecContext::frame_locked_alloc_size
unsigned int frame_locked_alloc_size
Definition: vulkan.h:157
len
int len
Definition: vorbis_enc_data.h:426
filt
static const int8_t filt[NUMTAPS *2]
Definition: af_earwax.c:40
FFVulkanContext::extensions
FFVulkanExtensions extensions
Definition: vulkan.h:275
FFVulkanContext::nb_qfs
int nb_qfs
Definition: vulkan.h:312
FFVulkanContext::mprops
VkPhysicalDeviceMemoryProperties mprops
Definition: vulkan.h:279
FFVulkanDescriptorSet::binding_offset
VkDeviceSize * binding_offset
Definition: vulkan.h:179
FFVkExecContext::sem_wait_alloc
unsigned int sem_wait_alloc
Definition: vulkan.h:145
AVHWFramesContext
This struct describes a set or pool of "hardware" frames (i.e.
Definition: hwcontext.h:118
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.
Definition: vulkan.c:2840
FFVulkanContext::desc_buf_props
VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props
Definition: vulkan.h:281
ff_comp_identity_map
const VkComponentMapping ff_comp_identity_map
Definition: vulkan.c:27
FFVulkanShader::name
const char * name
Definition: vulkan.h:188
FFVulkanContext::vkfn
FFVulkanFunctions vkfn
Definition: vulkan.h:274
FFVkExecContext::opaque
void * opaque
Definition: vulkan.h:124
FFVkExecPool
Definition: vulkan.h:248
FFVkExecContext::frame_locked
uint8_t * frame_locked
Definition: vulkan.h:156
FFVkExecPool::query_data
void * query_data
Definition: vulkan.h:257
FFVkExecContext::sem_sig
VkSemaphoreSubmitInfo * sem_sig
Definition: vulkan.h:148
FFVkExecContext::buf
VkCommandBuffer buf
Definition: vulkan.h:118
ff_vk_alloc_mem
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: vulkan.c:974
FFVulkanContext::input_format
enum AVPixelFormat input_format
Definition: vulkan.h:318
FFVulkanShader::desc_set
FFVulkanDescriptorSet * desc_set
Definition: vulkan.h:215
FFVulkanContext::coop_mat_props_nb
uint32_t coop_mat_props_nb
Definition: vulkan.h:294
vulkan_functions.h
ff_vk_exec_update_frame
void ff_vk_exec_update_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, VkImageMemoryBarrier2 *bar, uint32_t *nb_img_bar)
Definition: vulkan.c:863
FFVulkanContext::video_props
VkQueueFamilyVideoPropertiesKHR * video_props
Definition: vulkan.h:287
FFVulkanShader::object
VkShaderEXT object
Definition: vulkan.h:204
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:117
ff_vk_map_feats_to_usage
VkImageUsageFlags ff_vk_map_feats_to_usage(VkFormatFeatureFlagBits2 feats)
Map between usage and features.
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
FFVulkanDescriptorSet::usage
VkBufferUsageFlags usage
Definition: vulkan.h:176
ff_vk_exec_pool_free
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
Definition: vulkan.c:291
desc
const char * desc
Definition: libsvtav1.c:78
FFVulkanContext::hwctx
AVVulkanDeviceContext * hwctx
Definition: vulkan.h:304
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
FFVkExecPool::cmd_bufs
VkCommandBuffer * cmd_bufs
Definition: vulkan.h:253
FFVulkanContext::push_desc_props
VkPhysicalDevicePushDescriptorPropertiesKHR push_desc_props
Definition: vulkan.h:284
FFVulkanContext::feats_12
VkPhysicalDeviceVulkan12Features feats_12
Definition: vulkan.h:297
FFVkExecContext::sw_frame_deps
AVFrame ** sw_frame_deps
Definition: vulkan.h:140
ff_vk_count_images
static int ff_vk_count_images(AVVkFrame *f)
Definition: vulkan.h:321
FFVkBuffer::virtual_offset
size_t virtual_offset
Definition: vulkan.h:101
FFVkExecContext::buf_deps_alloc_size
unsigned int buf_deps_alloc_size
Definition: vulkan.h:132
FFVkExecContext::buf_deps
AVBufferRef ** buf_deps
Definition: vulkan.h:130
FFVkBuffer
Definition: vulkan.h:87
hwcontext.h
AVVulkanDeviceQueueFamily
Definition: hwcontext_vulkan.h:33
FFVkExecPool::qd_size
size_t qd_size
Definition: vulkan.h:263
FFVulkanContext::frames
AVHWFramesContext * frames
Definition: vulkan.h:308
FFVulkanDescriptorSet
Definition: vulkan.h:172
FFVulkanContext::optical_flow_props
VkPhysicalDeviceOpticalFlowPropertiesNV optical_flow_props
Definition: vulkan.h:285
ff_vk_set_perm
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.
Definition: vulkan.c:1584
FFVkExecPool::query_results
int query_results
Definition: vulkan.h:258
FFVkExecContext::sem_sig_val_dst
uint64_t ** sem_sig_val_dst
Definition: vulkan.h:152
FFVulkanContext::query_props
VkQueueFamilyQueryResultStatusPropertiesKHR * query_props
Definition: vulkan.h:286
FFVulkanContext::host_image_copy_layouts
VkImageLayout * host_image_copy_layouts
Definition: vulkan.h:291
FFVulkanDescriptorSetBinding::mem_quali
const char * mem_quali
Definition: vulkan.h:78
FFVulkanFunctions
Definition: vulkan_functions.h:280
FFVkExecPool::pool_size
int pool_size
Definition: vulkan.h:254
FFVulkanContext::coop_mat_props
VkCooperativeMatrixPropertiesKHR * coop_mat_props
Definition: vulkan.h:293
FFVkExecContext::idx
uint32_t idx
Definition: vulkan.h:108
src
#define src
Definition: vp8dsp.c:248
atomic_uint_least64_t
intptr_t atomic_uint_least64_t
Definition: stdatomic.h:69
FFVulkanShader::lg_size
int lg_size[3]
Definition: vulkan.h:194
FFVkExecContext::access_dst
VkAccessFlagBits * access_dst
Definition: vulkan.h:159