MCPcopy Create free account
hub / github.com/baldurk/renderdoc / debugVertex

Method debugVertex

qrenderdoc/Windows/BufferViewer.cpp:6767–6837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6765}
6766
6767void BufferViewer::debugVertex()
6768{
6769 if(!m_Ctx.IsCaptureLoaded())
6770 return;
6771
6772 if(!m_Ctx.CurAction())
6773 return;
6774
6775 if(!m_CurView)
6776 return;
6777
6778 QModelIndex idx = m_CurView->selectionModel()->currentIndex();
6779
6780 if(!idx.isValid())
6781 {
6782 GUIInvoke::call(this, [this]() {
6783 RDDialog::critical(this, tr("Error debugging"),
6784 tr("Error debugging vertex - make sure a valid vertex is selected"));
6785 });
6786 return;
6787 }
6788
6789 uint32_t vertid =
6790 m_CurView->model()->data(m_CurView->model()->index(idx.row(), 0), Qt::DisplayRole).toUInt();
6791 uint32_t index =
6792 m_CurView->model()->data(m_CurView->model()->index(idx.row(), 1), Qt::DisplayRole).toUInt();
6793 uint32_t view = m_Config.curView;
6794
6795 bool done = false;
6796 ShaderDebugTrace *trace = NULL;
6797
6798 m_Ctx.Replay().AsyncInvoke([this, &done, &trace, vertid, index, view](IReplayController *r) {
6799 trace = r->DebugVertex(vertid, m_Config.curInstance, index, view);
6800
6801 if(trace->debugger == NULL)
6802 {
6803 r->FreeTrace(trace);
6804 trace = NULL;
6805 }
6806
6807 done = true;
6808 });
6809
6810 QString debugContext = tr("Vertex %1").arg(vertid);
6811
6812 if(m_Ctx.CurAction()->numInstances > 1)
6813 debugContext += tr(", Instance %1").arg(m_Config.curInstance);
6814
6815 // wait a short while before displaying the progress dialog (which won't show if we're already
6816 // done by the time we reach it)
6817 for(int i = 0; !done && i < 100; i++)
6818 QThread::msleep(5);
6819
6820 ShowProgressDialog(this, tr("Debugging %1").arg(debugContext), [&done]() { return done; });
6821
6822 if(!trace)
6823 {
6824 RDDialog::critical(this, tr("Error debugging"),

Callers

nothing calls this directly

Calls 15

criticalFunction · 0.85
ShowProgressDialogFunction · 0.85
FreeTraceMethod · 0.80
trFunction · 0.50
IsCaptureLoadedMethod · 0.45
CurActionMethod · 0.45
isValidMethod · 0.45
dataMethod · 0.45
modelMethod · 0.45
indexMethod · 0.45
rowMethod · 0.45
AsyncInvokeMethod · 0.45

Tested by

no test coverage detected