diff options
author | Lynne <dev@lynne.ee> | 2021-11-19 12:07:10 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2021-11-19 13:44:47 +0100 |
commit | b2aec70bd6bbf4620d363dfdc7d9e54f2f32f9ee (patch) | |
tree | 1762efe01831e0e0d9804c1d551c739b3bb58bbf /libavutil/vulkan.h | |
parent | d1133e8c44f457f0698c48f2efcedbd8626b3cee (diff) | |
download | ffmpeg-b2aec70bd6bbf4620d363dfdc7d9e54f2f32f9ee.tar.gz |
lavu/vulkan: add option to switch between shader compilers and cleanup glslang
Diffstat (limited to 'libavutil/vulkan.h')
-rw-r--r-- | libavutil/vulkan.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index 14c69ce015..3d89f02732 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -22,6 +22,10 @@ #define VK_NO_PROTOTYPES #define VK_ENABLE_BETA_EXTENSIONS +#ifndef FF_VK_ENABLE_SHADER_COMPILATION +#define FF_VK_ENABLE_SHADER_COMPILATION 1 +#endif + #include "pixdesc.h" #include "bprint.h" #include "hwcontext.h" @@ -64,6 +68,15 @@ typedef struct FFVkSPIRVShader { VkPipelineShaderStageCreateInfo shader; } FFVkSPIRVShader; +typedef struct FFVkSPIRVCompiler { + void *priv; + int (*compile_shader)(struct FFVkSPIRVCompiler *ctx, void *avctx, + struct FFVkSPIRVShader *shd, uint8_t **data, + size_t *size, const char *entrypoint, void **opaque); + void (*free_shader)(struct FFVkSPIRVCompiler *ctx, void **opaque); + void (*uninit)(struct FFVkSPIRVCompiler **ctx); +} FFVkSPIRVCompiler; + typedef struct FFVkSampler { VkSampler sampler[4]; } FFVkSampler; @@ -194,6 +207,8 @@ typedef struct FFVulkanContext { AVHWFramesContext *frames; AVVulkanFramesContext *hwfc; + FFVkSPIRVCompiler *spirv_compiler; + /* Properties */ int output_width; int output_height; |