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

Method startDebug

qrenderdoc/Windows/PixelHistoryView.cpp:774–842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774void PixelHistoryView::startDebug(EventTag tag)
775{
776 m_Ctx.SetEventID({this}, tag.eventId, tag.eventId);
777
778 const ShaderReflection *shaderDetails =
779 m_Ctx.CurPipelineState().GetShaderReflection(ShaderStage::Pixel);
780
781 if(!m_Ctx.APIProps().shaderDebugging)
782 {
783 RDDialog::critical(this, tr("Can't debug pixel"),
784 tr("This API does not support shader debugging"));
785 return;
786 }
787 else if(!shaderDetails)
788 {
789 RDDialog::critical(this, tr("Can't debug pixel"),
790 tr("No pixel shader bound at event %1").arg(tag.eventId));
791 return;
792 }
793 else if(!shaderDetails->debugInfo.debuggable)
794 {
795 RDDialog::critical(
796 this, tr("Can't debug pixel"),
797 tr("This shader doesn't support debugging: %1").arg(shaderDetails->debugInfo.debugStatus));
798 return;
799 }
800
801 bool done = false;
802 ShaderDebugTrace *trace = NULL;
803
804 m_Ctx.Replay().AsyncInvoke([this, &trace, &done, tag](IReplayController *r) {
805 DebugPixelInputs inputs;
806 inputs.sample = m_Display.subresource.sample;
807 inputs.primitive = tag.primitive;
808 inputs.view = m_View;
809 trace = r->DebugPixel((uint32_t)m_Pixel.x(), (uint32_t)m_Pixel.y(), inputs);
810
811 if(trace->debugger == NULL)
812 {
813 r->FreeTrace(trace);
814 trace = NULL;
815 }
816
817 done = true;
818 });
819
820 QString debugContext =
821 QFormatStr("Pixel %1,%2 @ %3").arg(m_Pixel.x()).arg(m_Pixel.y()).arg(tag.eventId);
822
823 // wait a short while before displaying the progress dialog (which won't show if we're already
824 // done by the time we reach it)
825 for(int i = 0; !done && i < 100; i++)
826 QThread::msleep(5);
827
828 ShowProgressDialog(this, tr("Debugging %1").arg(debugContext), [&done]() { return done; });
829
830 if(!trace)
831 {

Callers

nothing calls this directly

Calls 13

criticalFunction · 0.85
ShowProgressDialogFunction · 0.85
FreeTraceMethod · 0.80
trFunction · 0.50
SetEventIDMethod · 0.45
argMethod · 0.45
AsyncInvokeMethod · 0.45
DebugPixelMethod · 0.45
xMethod · 0.45
yMethod · 0.45
DebugShaderMethod · 0.45
AddDockWindowMethod · 0.45

Tested by

no test coverage detected