Unified · Split
| @@ -41,6 +41,14 @@ static int shdc_shader_compile(FFVulkanContext *s, FFVkSPIRVCompiler *ctx, · 40 unmodified lines | |||
| 41 | [VK_SHADER_STAGE_VERTEX_BIT] = shaderc_glsl_vertex_shader, | 41 | [VK_SHADER_STAGE_VERTEX_BIT] = shaderc_glsl_vertex_shader, |
| 42 | [VK_SHADER_STAGE_FRAGMENT_BIT] = shaderc_glsl_fragment_shader, | 42 | [VK_SHADER_STAGE_FRAGMENT_BIT] = shaderc_glsl_fragment_shader, |
| 43 | [VK_SHADER_STAGE_COMPUTE_BIT] = shaderc_glsl_compute_shader, | 43 | [VK_SHADER_STAGE_COMPUTE_BIT] = shaderc_glsl_compute_shader, |
| 44 | [VK_SHADER_STAGE_MESH_BIT_EXT] = shaderc_mesh_shader, | ||
| 45 | [VK_SHADER_STAGE_TASK_BIT_EXT] = shaderc_task_shader, | ||
| 46 | [VK_SHADER_STAGE_RAYGEN_BIT_KHR] = shaderc_raygen_shader, | ||
| 47 | [VK_SHADER_STAGE_ANY_HIT_BIT_KHR] = shaderc_anyhit_shader, | ||
| 48 | [VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR] = shaderc_closesthit_shader, | ||
| 49 | [VK_SHADER_STAGE_MISS_BIT_KHR] = shaderc_miss_shader, | ||
| 50 | [VK_SHADER_STAGE_INTERSECTION_BIT_KHR] = shaderc_intersection_shader, | ||
| 51 | [VK_SHADER_STAGE_CALLABLE_BIT_KHR] = shaderc_callable_shader, | ||
| 44 | }; | 52 | }; |
| 45 | 53 | ||
| 46 | shaderc_compile_options_t opts = shaderc_compile_options_initialize(); | 54 | shaderc_compile_options_t opts = shaderc_compile_options_initialize(); |
| @@ -49,11 +57,17 @@ static int shdc_shader_compile(FFVulkanContext *s, FFVkSPIRVCompiler *ctx, · 2 unmodified lines | |||
| 49 | return AVERROR(ENOMEM); | 57 | return AVERROR(ENOMEM); |
| 50 | 58 | ||
| 51 | shaderc_compile_options_set_target_env(opts, shaderc_target_env_vulkan, | 59 | shaderc_compile_options_set_target_env(opts, shaderc_target_env_vulkan, |
| 52 | shaderc_env_version_vulkan_1_2); | 60 | shaderc_env_version_vulkan_1_3); |
| 53 | shaderc_compile_options_set_target_spirv(opts, shaderc_spirv_version_1_5); | 61 | shaderc_compile_options_set_target_spirv(opts, shaderc_spirv_version_1_6); |
| 54 | shaderc_compile_options_set_generate_debug_info(opts); | 62 | |
| 55 | shaderc_compile_options_set_optimization_level(opts, | 63 | if (s->extensions & FF_VK_EXT_DEBUG_UTILS) { |
| 56 | shaderc_optimization_level_performance); | 64 | shaderc_compile_options_set_generate_debug_info(opts); |
| 65 | shaderc_compile_options_set_optimization_level(opts, | ||
| 66 | shaderc_optimization_level_zero); | ||
| 67 | } else { | ||
| 68 | shaderc_compile_options_set_optimization_level(opts, | ||
| 69 | shaderc_optimization_level_performance); | ||
| 70 | } | ||
| 57 | 71 | ||
| 58 | res = shaderc_compile_into_spv((shaderc_compiler_t)ctx->priv, | 72 | res = shaderc_compile_into_spv((shaderc_compiler_t)ctx->priv, |
| 59 | shd->src.str, strlen(shd->src.str), | 73 | shd->src.str, strlen(shd->src.str), |