mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-13 02:01:08 +00:00
DXIL Debugger match ExtractInputsPS compile options to vertex shader
Use the same SM profile Compile with -enable-16-bit-types if the vertex shader has the flag NativeLowPrecision
This commit is contained in:
@@ -2661,8 +2661,26 @@ struct PSInitialData
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_pDevice->GetShaderCache()->GetShaderBlob(extractHlsl.c_str(), "ExtractInputsPS", flags, {},
|
||||
"ps_6_0", &psBlob) != "")
|
||||
// get the profile and shader compile flags from the vertex shader
|
||||
rdcstr compSig = dxbc->GetDXILByteCode()->GetCompilerSig();
|
||||
const uint32_t smMajor = dxbc->m_Version.Major;
|
||||
const uint32_t smMinor = dxbc->m_Version.Minor;
|
||||
if(smMajor < 6)
|
||||
{
|
||||
RDCERR("Invalid vertex shader SM %d.%d expect SM6.0+", smMajor, smMinor);
|
||||
return new ShaderDebugTrace;
|
||||
}
|
||||
const char *profile = StringFormat::Fmt("ps_%u_%u", smMajor, smMinor).c_str();
|
||||
|
||||
ShaderCompileFlags compileFlags =
|
||||
DXBC::EncodeFlags(m_pDevice->GetShaderCache()->GetCompileFlags(), profile);
|
||||
|
||||
const GlobalShaderFlags shaderFlags = dxbc->GetGlobalShaderFlags();
|
||||
if(shaderFlags & GlobalShaderFlags::NativeLowPrecision)
|
||||
compileFlags.flags.push_back({"@compile_option", "-enable-16bit-types"});
|
||||
|
||||
if(m_pDevice->GetShaderCache()->GetShaderBlob(extractHlsl.c_str(), "ExtractInputsPS",
|
||||
compileFlags, {}, profile, &psBlob) != "")
|
||||
{
|
||||
RDCERR("Failed to create shader to extract inputs");
|
||||
return new ShaderDebugTrace;
|
||||
|
||||
Reference in New Issue
Block a user