Gather and display callstack information during shader debugging

This commit is contained in:
baldurk
2018-06-22 19:28:30 +01:00
parent 165434a1f0
commit e2dcd902cd
11 changed files with 121 additions and 26 deletions
+15 -1
View File
@@ -69,6 +69,7 @@ ShaderViewer::ShaderViewer(ICaptureContext &ctx, QWidget *parent)
ui->watch->setFont(Formatter::PreferredFont());
ui->inputSig->setFont(Formatter::PreferredFont());
ui->outputSig->setFont(Formatter::PreferredFont());
ui->callstack->setFont(Formatter::PreferredFont());
// we create this up front so its state stays persistent as much as possible.
m_FindReplace = new FindReplace(this);
@@ -204,10 +205,11 @@ void ShaderViewer::editShader(bool customShader, const QString &entryPoint, cons
m_DisassemblyView = NULL;
// hide watch, constants, variables
// hide debugging windows
ui->watch->hide();
ui->variables->hide();
ui->constants->hide();
ui->callstack->hide();
ui->snippets->setVisible(customShader);
@@ -460,6 +462,13 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
ui->docking->setToolWindowProperties(
ui->constants, ToolWindowManager::HideCloseButton | ToolWindowManager::DisallowFloatWindow);
ui->callstack->setWindowTitle(tr("Callstack"));
ui->docking->addToolWindow(
ui->callstack, ToolWindowManager::AreaReference(ToolWindowManager::RightOf,
ui->docking->areaOf(ui->variables), 0.2f));
ui->docking->setToolWindowProperties(
ui->callstack, ToolWindowManager::HideCloseButton | ToolWindowManager::DisallowFloatWindow);
m_DisassemblyView->setMarginWidthN(1, 20.0 * devicePixelRatioF());
// display current line in margin 2, distinct from breakpoint in margin 1
@@ -1227,6 +1236,11 @@ void ShaderViewer::updateDebugging()
}
}
ui->callstack->clear();
for(const rdcstr &s : state.callstack)
ui->callstack->insertItem(0, s);
if(ui->constants->topLevelItemCount() == 0)
{
for(int i = 0; i < m_Trace->constantBlocks.count(); i++)