mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-25 07:56:33 +00:00
Add 'run to sample/load/gather' and 'run to generated inf/nan'.
- ShaderDebugState now carries a 'flags' that can be updated when the interpreter is run. Currently supported flags are 'sample/load/gather insn' or 'insn generated nan/inf'. - DXBC interpreter now pushes operation type into results for simple intrinsics. This avoids the situation where temp decls are by default uint-typed, and any arithmetic operation on float or double operands would result in a uint shader variable. Other intrinsics are largely correct because they create temporaries with appropriate typed constructors. - Provide icons for user interface elements, based on the existing 'run to' icons with modifications by myself.
This commit is contained in:
committed by
Baldur Karlsson
parent
d249faacd3
commit
366581fb3f
+28
@@ -78,6 +78,8 @@
|
||||
this.stepBack = new System.Windows.Forms.ToolStripButton();
|
||||
this.stepNext = new System.Windows.Forms.ToolStripButton();
|
||||
this.runToCursor = new System.Windows.Forms.ToolStripButton();
|
||||
this.runToSample = new System.Windows.Forms.ToolStripButton();
|
||||
this.runToNanOrInf = new System.Windows.Forms.ToolStripButton();
|
||||
this.runBack = new System.Windows.Forms.ToolStripButton();
|
||||
this.run = new System.Windows.Forms.ToolStripButton();
|
||||
this.displayInts = new System.Windows.Forms.ToolStripButton();
|
||||
@@ -299,6 +301,8 @@
|
||||
this.stepBack,
|
||||
this.stepNext,
|
||||
this.runToCursor,
|
||||
this.runToSample,
|
||||
this.runToNanOrInf,
|
||||
this.runBack,
|
||||
this.run,
|
||||
this.showWindows,
|
||||
@@ -344,6 +348,28 @@
|
||||
this.runToCursor.ToolTipText = "Run to Cursor (Ctrl-F10)";
|
||||
this.runToCursor.Click += new System.EventHandler(this.runToCursor_Click);
|
||||
//
|
||||
// runToSample
|
||||
//
|
||||
this.runToSample.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.runToSample.Image = global::renderdocui.Properties.Resources.runsample;
|
||||
this.runToSample.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.runToSample.Name = "runToSample";
|
||||
this.runToSample.Size = new System.Drawing.Size(23, 22);
|
||||
this.runToSample.Text = "Run to Sample/Load/Gather";
|
||||
this.runToSample.ToolTipText = "Run to Sample/Load/Gather";
|
||||
this.runToSample.Click += new System.EventHandler(this.runToSample_Click);
|
||||
//
|
||||
// runToNanOrInf
|
||||
//
|
||||
this.runToNanOrInf.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.runToNanOrInf.Image = global::renderdocui.Properties.Resources.runnaninf;
|
||||
this.runToNanOrInf.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.runToNanOrInf.Name = "runToNanOrInf";
|
||||
this.runToNanOrInf.Size = new System.Drawing.Size(23, 22);
|
||||
this.runToNanOrInf.Text = "Run to NaN or Inf";
|
||||
this.runToNanOrInf.ToolTipText = "Run to NaN or Inf";
|
||||
this.runToNanOrInf.Click += new System.EventHandler(this.runToNanOrInf_Click);
|
||||
//
|
||||
// runBack
|
||||
//
|
||||
this.runBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
@@ -766,6 +792,8 @@
|
||||
private System.Windows.Forms.ToolStripButton stepBack;
|
||||
private System.Windows.Forms.ToolStripButton stepNext;
|
||||
private System.Windows.Forms.ToolStripButton runToCursor;
|
||||
private System.Windows.Forms.ToolStripButton runToSample;
|
||||
private System.Windows.Forms.ToolStripButton runToNanOrInf;
|
||||
private System.Windows.Forms.ToolStripButton runBack;
|
||||
private System.Windows.Forms.ToolStripButton run;
|
||||
private System.Windows.Forms.ToolStripDropDownButton showWindows;
|
||||
|
||||
@@ -1864,6 +1864,22 @@ namespace renderdocui.Windows
|
||||
RunToCursor();
|
||||
}
|
||||
|
||||
private void runToSample_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (m_Trace == null || m_Trace.states == null)
|
||||
return;
|
||||
|
||||
RunToSample();
|
||||
}
|
||||
|
||||
private void runToNanOrInf_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (m_Trace == null || m_Trace.states == null)
|
||||
return;
|
||||
|
||||
RunToNanOrInf();
|
||||
}
|
||||
|
||||
private bool StepBack()
|
||||
{
|
||||
if (m_Trace == null || m_Trace.states == null)
|
||||
@@ -1966,6 +1982,46 @@ namespace renderdocui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void RunToCondition(ShaderDebugStateFlags condition)
|
||||
{
|
||||
if (m_Trace == null || m_Trace.states == null)
|
||||
return;
|
||||
|
||||
int step = CurrentStep;
|
||||
|
||||
bool firstStep = true;
|
||||
|
||||
while (step < m_Trace.states.Length)
|
||||
{
|
||||
int nextStep = step + 1;
|
||||
|
||||
if (nextStep >= m_Trace.states.Length)
|
||||
break;
|
||||
|
||||
if (!firstStep && m_Trace.states[nextStep].flags.HasFlag(condition))
|
||||
break;
|
||||
|
||||
if (!firstStep && m_Breakpoints.Contains((int)m_Trace.states[step].nextInstruction))
|
||||
break;
|
||||
|
||||
firstStep = false;
|
||||
|
||||
step = nextStep;
|
||||
}
|
||||
|
||||
CurrentStep = step;
|
||||
}
|
||||
|
||||
private void RunToSample()
|
||||
{
|
||||
RunToCondition(ShaderDebugStateFlags.SampleLoadGather);
|
||||
}
|
||||
|
||||
private void RunToNanOrInf()
|
||||
{
|
||||
RunToCondition(ShaderDebugStateFlags.GeneratedNanOrInf);
|
||||
}
|
||||
|
||||
private void autosToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowConstants();
|
||||
|
||||
Reference in New Issue
Block a user