From f70a86042d0754d40ac4dd866ed7dfd6243a6e3e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 28 Aug 2018 15:45:32 +0100 Subject: [PATCH] Pass {glsl_stage4} parameter when calling for disassembly as well --- qrenderdoc/Code/Interface/ShaderProcessingTool.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp b/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp index b9459cef6..7fbbd582b 100644 --- a/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp +++ b/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp @@ -28,6 +28,10 @@ #include "Code/QRDUtils.h" #include "QRDInterface.h" +static const QString glsl_stage4[ENUM_ARRAY_SIZE(ShaderStage)] = { + lit("vert"), lit("tesc"), lit("tese"), lit("geom"), lit("frag"), lit("comp"), +}; + template <> std::string DoStringise(const KnownShaderTool &el) { @@ -186,6 +190,8 @@ ShaderToolOutput ShaderProcessingTool::DisassembleShader(QWidget *window, arg = input_file = tmpPath(lit("shader_input")); if(arg == lit("{output_file}")) arg = output_file = tmpPath(lit("shader_output")); + if(arg == lit("{glsl_stage4}")) + arg = glsl_stage4[int(shaderDetails->stage)]; } QFile binHandle(input_file); @@ -217,10 +223,6 @@ ShaderToolOutput ShaderProcessingTool::CompileShader(QWidget *window, rdcstr sou QString input_file, output_file; - const QString glsl_stage4[ENUM_ARRAY_SIZE(ShaderStage)] = { - lit("vert"), lit("tesc"), lit("tese"), lit("geom"), lit("frag"), lit("comp"), - }; - // replace arguments after expansion to avoid problems with quoting paths etc for(QString &arg : argList) {