mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-26 23:55:46 +00:00
Improve handling of compilers & command line for edited shaders
* We store the compiler used (when known) in shader debug info and use that to select the compiler for editing as even higher priority than the default for a given language/encoding combination. * We also ensure that for known tools we add the input and output parameters last, after any custom parameters, so that they are always present regardless of what the user puts in.
This commit is contained in:
@@ -978,10 +978,12 @@ void PipelineStateViewer::shaderEdit_clicked()
|
||||
|
||||
IShaderViewer *PipelineStateViewer::EditShader(ResourceId id, ShaderStage shaderType,
|
||||
const rdcstr &entry, ShaderCompileFlags compileFlags,
|
||||
ShaderEncoding encoding, const rdcstrpairs &files)
|
||||
KnownShaderTool knownTool,
|
||||
ShaderEncoding shaderEncoding,
|
||||
const rdcstrpairs &files)
|
||||
{
|
||||
IShaderViewer *sv =
|
||||
m_Ctx.EditShader(id, shaderType, entry, files, encoding, compileFlags, NULL, NULL);
|
||||
IShaderViewer *sv = m_Ctx.EditShader(id, shaderType, entry, files, knownTool, shaderEncoding,
|
||||
compileFlags, NULL, NULL);
|
||||
|
||||
m_Ctx.AddDockWindow(sv->Widget(), DockReference::AddTo, this);
|
||||
|
||||
@@ -1025,7 +1027,8 @@ IShaderViewer *PipelineStateViewer::EditOriginalShaderSource(ResourceId id,
|
||||
}
|
||||
|
||||
return EditShader(id, shaderDetails->stage, shaderDetails->entryPoint,
|
||||
shaderDetails->debugInfo.compileFlags, shaderDetails->debugInfo.encoding, files);
|
||||
shaderDetails->debugInfo.compileFlags, shaderDetails->debugInfo.compiler,
|
||||
shaderDetails->debugInfo.encoding, files);
|
||||
}
|
||||
|
||||
IShaderViewer *PipelineStateViewer::EditDecompiledSource(const ShaderProcessingTool &tool,
|
||||
@@ -1040,8 +1043,8 @@ IShaderViewer *PipelineStateViewer::EditDecompiledSource(const ShaderProcessingT
|
||||
rdcstrpairs files;
|
||||
files.push_back(rdcpair<rdcstr, rdcstr>("decompiled", source));
|
||||
|
||||
IShaderViewer *sv =
|
||||
EditShader(id, shaderDetails->stage, shaderDetails->entryPoint, {}, tool.output, files);
|
||||
IShaderViewer *sv = EditShader(id, shaderDetails->stage, shaderDetails->entryPoint, {},
|
||||
KnownShaderTool::Unknown, tool.output, files);
|
||||
|
||||
sv->ShowErrors(out.log);
|
||||
|
||||
@@ -1133,7 +1136,8 @@ void PipelineStateViewer::SetupShaderEditButton(QToolButton *button, ResourceId
|
||||
files.push_back(rdcpair<rdcstr, rdcstr>("pseudocode", editeddisasm));
|
||||
|
||||
EditShader(shaderId, shaderDetails->stage, shaderDetails->entryPoint,
|
||||
shaderDetails->debugInfo.compileFlags, ShaderEncoding::Unknown, files);
|
||||
shaderDetails->debugInfo.compileFlags, KnownShaderTool::Unknown,
|
||||
ShaderEncoding::Unknown, files);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1147,7 +1151,7 @@ void PipelineStateViewer::SetupShaderEditButton(QToolButton *button, ResourceId
|
||||
"decompiled_stub.hlsl", GenerateHLSLStub(bindpointMapping, shaderDetails, entry)));
|
||||
|
||||
EditShader(shaderId, shaderDetails->stage, entry, shaderDetails->debugInfo.compileFlags,
|
||||
ShaderEncoding::HLSL, files);
|
||||
KnownShaderTool::Unknown, ShaderEncoding::HLSL, files);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user