If D3DCOMPILE_SKIP_OPTIMIZATION is set, prefer source-level debugging

This commit is contained in:
baldurk
2018-06-22 19:28:34 +01:00
parent 04f214c768
commit fc3e527181
2 changed files with 25 additions and 0 deletions
+19
View File
@@ -328,7 +328,26 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
m_DisassemblyView->setText(disasm.c_str());
m_DisassemblyView->setReadOnly(true);
bool preferSourceDebug = false;
for(const ShaderCompileFlag &flag : m_ShaderDetails->debugInfo.compileFlags.flags)
{
if(flag.name == "preferSourceDebug")
{
preferSourceDebug = true;
break;
}
}
updateDebugging();
// we do updateDebugging() again because the first call finds the scintilla for the current
// source file, the second time jumps to it.
if(preferSourceDebug)
{
gotoSourceDebugging();
updateDebugging();
}
});
});
}