diff options
author | Lynne <dev@lynne.ee> | 2023-03-02 13:02:25 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:51 +0200 |
commit | 33fc919bb7b5779cacabfb817fe6dd68a0454c8f (patch) | |
tree | 9514404226f2f9d85bb3150736849bbf0ba403cc /libavutil/vulkan.h | |
parent | 94e17a63a446d1c1dc5ae36fcf58fb43a6ef22fe (diff) |
hwcontext_vulkan: remove duplicate code, port to use generic vulkan utils
The temporary AVFrame on staack enables us to use the common
dependency/dispatch code in prepare_frame().
The prepare_frame() function is used for both frame initialization
and frame import/export queue family transfer operations.
In the former case, no AVFrame exists yet, so, as this is purely
libavutil code, we create a temporary frame on stack. Otherwise,
we'd need to allocate multiple frames somewhere, one for each
possible command buffer dispatch.
Diffstat (limited to 'libavutil/vulkan.h')
-rw-r--r-- | libavutil/vulkan.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index 0831219d8f..ec03ba8b71 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -267,6 +267,19 @@ static inline int ff_vk_count_images(AVVkFrame *f) return cnt; } +static inline const void *ff_vk_find_struct(const void *chain, VkStructureType stype) +{ + const VkBaseInStructure *in = chain; + while (in) { + if (in->sType == stype) + return in; + + in = in->pNext; + } + + return NULL; +} + /* Identity mapping - r = r, b = b, g = g, a = a */ extern const VkComponentMapping ff_comp_identity_map; |