Pass stencil as int32_t so depth or stencil of -1 indicates no data

This commit is contained in:
baldurk
2014-07-18 00:03:04 +01:00
parent e462ab15b3
commit 9075812226
5 changed files with 26 additions and 10 deletions
+2 -2
View File
@@ -3600,10 +3600,10 @@ vector<PixelModification> D3D11DebugManager::PixelHistory(uint32_t frameID, vect
float *data = (float *)(rowdata + 2 * sizeof(float) * (storex * 3 + 0));
mod.preMod.depth = data[0];
mod.preMod.stencil = int(data[1])&0xff;
mod.preMod.stencil = int32_t(data[1]);
mod.postMod.depth = data[2];
mod.postMod.stencil = int(data[3])&0xff;
mod.postMod.stencil = int32_t(data[3]);
}
// complex case - need to determine how many fragments from this draw wrote to the pixel and generate a
+1 -1
View File
@@ -206,7 +206,7 @@ struct ModificationValue
{
PixelValue col;
float depth;
uint8_t stencil;
int32_t stencil;
};
struct PixelModification
+1 -1
View File
@@ -463,7 +463,7 @@ namespace renderdoc
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
public PixelValue col;
public float depth;
public byte stencil;
public Int32 stencil;
};
[StructLayout(LayoutKind.Sequential)]
+2 -2
View File
@@ -50,7 +50,7 @@
treeListColumn2.CellFormat.TextAlignment = System.Drawing.ContentAlignment.TopLeft;
treeListColumn2.Width = 100;
treeListColumn3.AutoSizeMinSize = 10;
treeListColumn3.Width = 50;
treeListColumn3.Width = 60;
treeListColumn4.AutoSizeMinSize = 20;
treeListColumn4.Width = 40;
treeListColumn5.AutoSizeMinSize = 20;
@@ -69,7 +69,7 @@
this.events.Location = new System.Drawing.Point(0, 0);
this.events.MultiSelect = false;
this.events.Name = "events";
this.events.RowOptions.ItemHeight = 84;
this.events.RowOptions.ItemHeight = 96;
this.events.RowOptions.ShowHeader = false;
this.events.Size = new System.Drawing.Size(386, 478);
this.events.TabIndex = 1;
+20 -4
View File
@@ -142,11 +142,27 @@ namespace renderdocui.Windows
Formatter.Format(mod.postMod.col.value.f[3]);
}
preModVal += "\nD: " + Formatter.Format(mod.preMod.depth);
preModVal += String.Format("\nS: {0:X}", mod.preMod.stencil);
if (mod.preMod.depth >= 0.0f)
{
preModVal += "\nD: " + Formatter.Format(mod.preMod.depth);
postModVal += "\nD:" + Formatter.Format(mod.postMod.depth);
}
else
{
preModVal += "\nD: -";
postModVal += "\nD: -";
}
postModVal += "\nD:" + Formatter.Format(mod.postMod.depth);
postModVal += String.Format("\nS: {0:X}", mod.postMod.stencil);
if (mod.preMod.stencil >= 0)
{
preModVal += String.Format("\nS: {0:X}", mod.preMod.stencil);
postModVal += String.Format("\nS: {0:X}", mod.postMod.stencil);
}
else
{
preModVal += "\nS: -";
postModVal += "\nS: -";
}
var node = events.Nodes.Add(new object[] { mod.eventID, name, preModVal, "", postModVal, "" });