We need to know what extensions are supported.
Unified · Split
| @@ -137,7 +137,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) · 136 unmodified lines | ||
| 137 | 137 | } |
| 138 | 138 | GLSLC(0, } ); |
| 139 | 139 | |
| 140 | − RET(spv->compile_shader(spv, ctx, &s->shd, &spv_data, &spv_len, "main", | |
| 140 | + RET(spv->compile_shader(vkctx, spv, &s->shd, &spv_data, &spv_len, "main", | |
| 141 | 141 | &spv_opaque)); |
| 142 | 142 | RET(ff_vk_shader_link(vkctx, &s->shd, spv_data, spv_len, "main")); |
| 143 | 143 | |
| @@ -208,7 +208,7 @@ static av_cold int init_filter(AVFilterContext *avctx) · 207 unmodified lines | ||
| 208 | 208 | } |
| 209 | 209 | GLSLC(0, } ); |
| 210 | 210 | |
| 211 | − RET(spv->compile_shader(spv, avctx, shd, &spv_data, &spv_len, "main", | |
| 211 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 212 | 212 | &spv_opaque)); |
| 213 | 213 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 214 | 214 | |
| @@ -244,7 +244,7 @@ static av_cold int init_filter(AVFilterContext *ctx) · 243 unmodified lines | ||
| 244 | 244 | |
| 245 | 245 | GLSLC(0, } ); |
| 246 | 246 | |
| 247 | − RET(spv->compile_shader(spv, ctx, &s->shd, &spv_data, &spv_len, "main", | |
| 247 | + RET(spv->compile_shader(vkctx, spv, &s->shd, &spv_data, &spv_len, "main", | |
| 248 | 248 | &spv_opaque)); |
| 249 | 249 | RET(ff_vk_shader_link(vkctx, &s->shd, spv_data, spv_len, "main")); |
| 250 | 250 | |
| @@ -148,7 +148,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) · 147 unmodified lines | ||
| 148 | 148 | } |
| 149 | 149 | GLSLC(0, } ); |
| 150 | 150 | |
| 151 | − RET(spv->compile_shader(spv, ctx, shd, &spv_data, &spv_len, "main", | |
| 151 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 152 | 152 | &spv_opaque)); |
| 153 | 153 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 154 | 154 | |
| @@ -121,7 +121,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in, enum FlipType · 120 unmodified lines | ||
| 121 | 121 | } |
| 122 | 122 | GLSLC(0, } ); |
| 123 | 123 | |
| 124 | − RET(spv->compile_shader(spv, ctx, shd, &spv_data, &spv_len, "main", | |
| 124 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 125 | 125 | &spv_opaque)); |
| 126 | 126 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 127 | 127 | |
| @@ -169,7 +169,7 @@ static int init_gblur_pipeline(GBlurVulkanContext *s, · 168 unmodified lines | ||
| 169 | 169 | } |
| 170 | 170 | GLSLC(0, } ); |
| 171 | 171 | |
| 172 | − RET(spv->compile_shader(spv, s, shd, &spv_data, &spv_len, "main", | |
| 172 | + RET(spv->compile_shader(&s->vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 173 | 173 | &spv_opaque)); |
| 174 | 174 | RET(ff_vk_shader_link(&s->vkctx, shd, spv_data, spv_len, "main")); |
| 175 | 175 | |
| @@ -402,7 +402,7 @@ static av_cold int init_weights_pipeline(FFVulkanContext *vkctx, FFVkExecPool *e · 401 unmodified lines | ||
| 402 | 402 | |
| 403 | 403 | GLSLC(0, } ); |
| 404 | 404 | |
| 405 | − RET(spv->compile_shader(spv, vkctx, shd, &spv_data, &spv_len, "main", &spv_opaque)); | |
| 405 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", &spv_opaque)); | |
| 406 | 406 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 407 | 407 | |
| 408 | 408 | RET(ff_vk_shader_register_exec(vkctx, exec, shd)); |
| @@ -553,7 +553,7 @@ static av_cold int init_denoise_pipeline(FFVulkanContext *vkctx, FFVkExecPool *e · 144 unmodified lines | ||
| 553 | 553 | GLSLC(1, imageStore(output_img[plane], pos, r); ); |
| 554 | 554 | GLSLC(0, } ); |
| 555 | 555 | |
| 556 | − RET(spv->compile_shader(spv, vkctx, shd, &spv_data, &spv_len, "main", &spv_opaque)); | |
| 556 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", &spv_opaque)); | |
| 557 | 557 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 558 | 558 | |
| 559 | 559 | RET(ff_vk_shader_register_exec(vkctx, exec, shd)); |
| @@ -163,7 +163,7 @@ static av_cold int init_filter(AVFilterContext *ctx) · 162 unmodified lines | ||
| 163 | 163 | GLSLC(1, } ); |
| 164 | 164 | GLSLC(0, } ); |
| 165 | 165 | |
| 166 | − RET(spv->compile_shader(spv, ctx, shd, &spv_data, &spv_len, "main", | |
| 166 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 167 | 167 | &spv_opaque)); |
| 168 | 168 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 169 | 169 | |
| @@ -247,7 +247,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) · 246 unmodified lines | ||
| 247 | 247 | s->opts.yuv_matrix[3][3] = 1.0; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | − RET(spv->compile_shader(spv, ctx, shd, &spv_data, &spv_len, "main", | |
| 250 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 251 | 251 | &spv_opaque)); |
| 252 | 252 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 253 | 253 | |
| @@ -113,7 +113,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) · 112 unmodified lines | ||
| 113 | 113 | } |
| 114 | 114 | GLSLC(0, } ); |
| 115 | 115 | |
| 116 | − RET(spv->compile_shader(spv, ctx, shd, &spv_data, &spv_len, "main", | |
| 116 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 117 | 117 | &spv_opaque)); |
| 118 | 118 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 119 | 119 | |
| @@ -393,7 +393,7 @@ static av_cold int init_vulkan(AVFilterContext *avctx) · 392 unmodified lines | ||
| 393 | 393 | GLSLC(1, } ); |
| 394 | 394 | GLSLC(0, } ); |
| 395 | 395 | |
| 396 | − RET(spv->compile_shader(spv, avctx, shd, &spv_data, &spv_len, "main", | |
| 396 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 397 | 397 | &spv_opaque)); |
| 398 | 398 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 399 | 399 | |
| @@ -179,7 +179,7 @@ static av_cold int init_filter(AVFilterContext *ctx, enum TestSrcVulkanMode mode · 178 unmodified lines | ||
| 179 | 179 | } |
| 180 | 180 | GLSLC(0, } ); |
| 181 | 181 | |
| 182 | − RET(spv->compile_shader(spv, ctx, shd, &spv_data, &spv_len, "main", | |
| 182 | + RET(spv->compile_shader(vkctx, spv, shd, &spv_data, &spv_len, "main", | |
| 183 | 183 | &spv_opaque)); |
| 184 | 184 | RET(ff_vk_shader_link(vkctx, shd, spv_data, spv_len, "main")); |
| 185 | 185 | |
| @@ -136,7 +136,7 @@ static const glslang_resource_t glslc_resource_limits = { · 135 unmodified lines | ||
| 136 | 136 | } |
| 137 | 137 | }; |
| 138 | 138 | |
| 139 | −static int glslc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, | |
| 139 | +static int glslc_shader_compile(FFVulkanContext *s, FFVkSPIRVCompiler *ctx, | |
| 140 | 140 | FFVulkanShader *shd, uint8_t **data, |
| 141 | 141 | size_t *size, const char *entrypoint, |
| 142 | 142 | void **opaque) |
| @@ -183,8 +183,8 @@ static int glslc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, · 40 unmodified lines | ||
| 183 | 183 | return AVERROR(ENOMEM); |
| 184 | 184 | |
| 185 | 185 | if (!glslang_shader_preprocess(glslc_shader, &glslc_input)) { |
| 186 | − ff_vk_shader_print(avctx, shd, AV_LOG_WARNING); | |
| 187 | − av_log(avctx, AV_LOG_ERROR, "Unable to preprocess shader: %s (%s)!\n", | |
| 186 | + ff_vk_shader_print(s, shd, AV_LOG_WARNING); | |
| 187 | + av_log(s, AV_LOG_ERROR, "Unable to preprocess shader: %s (%s)!\n", | |
| 188 | 188 | glslang_shader_get_info_log(glslc_shader), |
| 189 | 189 | glslang_shader_get_info_debug_log(glslc_shader)); |
| 190 | 190 | glslang_shader_delete(glslc_shader); |
| @@ -192,8 +192,8 @@ static int glslc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, · 1 unmodified line | ||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (!glslang_shader_parse(glslc_shader, &glslc_input)) { |
| 195 | − ff_vk_shader_print(avctx, shd, AV_LOG_WARNING); | |
| 196 | − av_log(avctx, AV_LOG_ERROR, "Unable to parse shader: %s (%s)!\n", | |
| 195 | + ff_vk_shader_print(s, shd, AV_LOG_WARNING); | |
| 196 | + av_log(s, AV_LOG_ERROR, "Unable to parse shader: %s (%s)!\n", | |
| 197 | 197 | glslang_shader_get_info_log(glslc_shader), |
| 198 | 198 | glslang_shader_get_info_debug_log(glslc_shader)); |
| 199 | 199 | glslang_shader_delete(glslc_shader); |
| @@ -209,8 +209,8 @@ static int glslc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, · 9 unmodified lines | ||
| 209 | 209 | |
| 210 | 210 | if (!glslang_program_link(glslc_program, GLSLANG_MSG_SPV_RULES_BIT | |
| 211 | 211 | GLSLANG_MSG_VULKAN_RULES_BIT)) { |
| 212 | − ff_vk_shader_print(avctx, shd, AV_LOG_WARNING); | |
| 213 | − av_log(avctx, AV_LOG_ERROR, "Unable to link shader: %s (%s)!\n", | |
| 212 | + ff_vk_shader_print(s, shd, AV_LOG_WARNING); | |
| 213 | + av_log(s, AV_LOG_ERROR, "Unable to link shader: %s (%s)!\n", | |
| 214 | 214 | glslang_program_get_info_log(glslc_program), |
| 215 | 215 | glslang_program_get_info_debug_log(glslc_program)); |
| 216 | 216 | glslang_program_delete(glslc_program); |
| @@ -222,10 +222,10 @@ static int glslc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, · 5 unmodified lines | ||
| 222 | 222 | |
| 223 | 223 | messages = glslang_program_SPIRV_get_messages(glslc_program); |
| 224 | 224 | if (messages) { |
| 225 | − ff_vk_shader_print(avctx, shd, AV_LOG_WARNING); | |
| 226 | − av_log(avctx, AV_LOG_WARNING, "%s\n", messages); | |
| 225 | + ff_vk_shader_print(s, shd, AV_LOG_WARNING); | |
| 226 | + av_log(s, AV_LOG_WARNING, "%s\n", messages); | |
| 227 | 227 | } else { |
| 228 | − ff_vk_shader_print(avctx, shd, AV_LOG_VERBOSE); | |
| 228 | + ff_vk_shader_print(s, shd, AV_LOG_VERBOSE); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | glslang_shader_delete(glslc_shader); |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include "libavutil/mem.h" |
| 22 | 22 | #include "vulkan_spirv.h" |
| 23 | 23 | |
| 24 | −static int shdc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, | |
| 24 | +static int shdc_shader_compile(FFVulkanContext *s, FFVkSPIRVCompiler *ctx, | |
| 25 | 25 | FFVulkanShader *shd, uint8_t **data, |
| 26 | 26 | size_t *size, const char *entrypoint, |
| 27 | 27 | void **opaque) |
| @@ -71,11 +71,11 @@ static int shdc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx, · 43 unmodified lines | ||
| 71 | 71 | |
| 72 | 72 | loglevel = err ? AV_LOG_ERROR : warn ? AV_LOG_WARNING : AV_LOG_VERBOSE; |
| 73 | 73 | |
| 74 | − ff_vk_shader_print(avctx, shd, loglevel); | |
| 74 | + ff_vk_shader_print(s, shd, loglevel); | |
| 75 | 75 | if (message && (err || warn)) |
| 76 | − av_log(avctx, loglevel, "%s\n", message); | |
| 76 | + av_log(s, loglevel, "%s\n", message); | |
| 77 | 77 | status = ret < FF_ARRAY_ELEMS(shdc_result) ? shdc_result[ret] : "unknown"; |
| 78 | − av_log(avctx, loglevel, "shaderc compile status '%s' (%d errors, %d warnings)\n", | |
| 78 | + av_log(s, loglevel, "shaderc compile status '%s' (%d errors, %d warnings)\n", | |
| 79 | 79 | status, err, warn); |
| 80 | 80 | |
| 81 | 81 | if (err > 0) |
| @@ -26,8 +26,8 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | typedef struct FFVkSPIRVCompiler { |
| 28 | 28 | void *priv; |
| 29 | − int (*compile_shader)(struct FFVkSPIRVCompiler *ctx, void *avctx, | |
| 30 | − struct FFVulkanShader *shd, uint8_t **data, | |
| 29 | + int (*compile_shader)(FFVulkanContext *s, struct FFVkSPIRVCompiler *ctx, | |
| 30 | + FFVulkanShader *shd, uint8_t **data, | |
| 31 | 31 | size_t *size, const char *entrypoint, void **opaque); |
| 32 | 32 | void (*free_shader)(struct FFVkSPIRVCompiler *ctx, void **opaque); |
| 33 | 33 | void (*uninit)(struct FFVkSPIRVCompiler **ctx); |