mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
ShaderCompiler: Attach source text to SPIR-V for debuggers like RenderDoc
This commit is contained in:
@ -196,7 +196,21 @@ static std::optional<SPIRVCodeVector> CompileShaderToSPV(EShLanguage stage,
|
||||
|
||||
SPIRVCodeVector out_code;
|
||||
spv::SpvBuildLogger logger;
|
||||
glslang::GlslangToSpv(*intermediate, out_code, &logger);
|
||||
glslang::SpvOptions options;
|
||||
|
||||
if (g_ActiveConfig.bEnableValidationLayer)
|
||||
{
|
||||
// Attach the source code to the SPIR-V for tools like RenderDoc.
|
||||
intermediate->addSourceText(pass_source_code, pass_source_code_length);
|
||||
|
||||
options.generateDebugInfo = true;
|
||||
options.disableOptimizer = true;
|
||||
options.optimizeSize = false;
|
||||
options.disassemble = false;
|
||||
options.validate = true;
|
||||
}
|
||||
|
||||
glslang::GlslangToSpv(*intermediate, out_code, &logger, &options);
|
||||
|
||||
// Write out messages
|
||||
// Temporary: skip if it contains "Warning, version 450 is not yet complete; most version-specific
|
||||
|
Reference in New Issue
Block a user