diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc index 3a181e51d20..a4165095c84 100644 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@ -15,6 +15,8 @@ #include "BLI_string_utils.h" #include "BLI_vector.hh" +#include "BKE_global.h" + using namespace blender::gpu::shader; extern "C" char datatoc_glsl_shader_defines_glsl[]; @@ -523,6 +525,10 @@ Vector VKShader::compile_glsl_to_spirv(Span sources, shaderc::Compiler &compiler = backend.get_shaderc_compiler(); shaderc::CompileOptions options; options.SetOptimizationLevel(shaderc_optimization_level_performance); + if (G.debug & G_DEBUG_GPU_RENDERDOC) { + options.SetOptimizationLevel(shaderc_optimization_level_zero); + options.SetGenerateDebugInfo(); + } shaderc::SpvCompilationResult module = compiler.CompileGlslToSpv( combined_sources, stage, name, options);