mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-20 05:26:42 +00:00
Show depth and stencil states on GL pipeline view
This commit is contained in:
@@ -119,6 +119,37 @@ struct GLPipelineState
|
||||
bool32 AntialiasedLineEnable;
|
||||
} m_State;
|
||||
} m_Rasterizer;
|
||||
|
||||
struct DepthState
|
||||
{
|
||||
DepthState()
|
||||
: DepthEnable(false), DepthWrites(false), DepthBounds(false),
|
||||
NearBound(0), FarBound(0) {}
|
||||
bool32 DepthEnable;
|
||||
rdctype::str DepthFunc;
|
||||
bool32 DepthWrites;
|
||||
bool32 DepthBounds;
|
||||
double NearBound, FarBound;
|
||||
} m_DepthState;
|
||||
|
||||
struct StencilState
|
||||
{
|
||||
StencilState()
|
||||
: StencilEnable(false) {}
|
||||
bool32 StencilEnable;
|
||||
|
||||
struct StencilOp
|
||||
{
|
||||
StencilOp() : Ref(0), ValueMask(0), WriteMask(0) {}
|
||||
rdctype::str FailOp;
|
||||
rdctype::str DepthFailOp;
|
||||
rdctype::str PassOp;
|
||||
rdctype::str Func;
|
||||
uint32_t Ref;
|
||||
uint32_t ValueMask;
|
||||
uint32_t WriteMask;
|
||||
} m_FrontFace, m_BackFace;
|
||||
} m_StencilState;
|
||||
|
||||
struct FrameBuffer
|
||||
{
|
||||
|
||||
@@ -1315,6 +1315,32 @@ void GLReplay::SavePipelineState()
|
||||
pipe.m_Rasterizer.m_State.MultisampleEnable = rs.Enabled[GLRenderState::eEnabled_Multisample];
|
||||
pipe.m_Rasterizer.m_State.AntialiasedLineEnable = rs.Enabled[GLRenderState::eEnabled_LineSmooth];
|
||||
|
||||
// depth and stencil states
|
||||
|
||||
pipe.m_DepthState.DepthEnable = rs.Enabled[GLRenderState::eEnabled_DepthTest];
|
||||
pipe.m_DepthState.DepthWrites = rs.DepthWriteMask != 0;
|
||||
pipe.m_DepthState.DepthFunc = ToStr::Get(rs.DepthFunc).substr(3);
|
||||
|
||||
pipe.m_DepthState.DepthBounds = rs.Enabled[GLRenderState::eEnabled_DepthBoundsEXT];
|
||||
pipe.m_DepthState.NearBound = rs.DepthBounds.nearZ;
|
||||
pipe.m_DepthState.FarBound = rs.DepthBounds.farZ;
|
||||
|
||||
pipe.m_StencilState.StencilEnable = rs.Enabled[GLRenderState::eEnabled_StencilTest];
|
||||
pipe.m_StencilState.m_FrontFace.ValueMask = rs.StencilFront.valuemask;
|
||||
pipe.m_StencilState.m_FrontFace.WriteMask = rs.StencilFront.writemask;
|
||||
pipe.m_StencilState.m_FrontFace.Ref = rs.StencilFront.ref;
|
||||
pipe.m_StencilState.m_FrontFace.Func = ToStr::Get(rs.StencilFront.func).substr(3);
|
||||
pipe.m_StencilState.m_FrontFace.PassOp = ToStr::Get(rs.StencilFront.pass).substr(3);
|
||||
pipe.m_StencilState.m_FrontFace.FailOp = ToStr::Get(rs.StencilFront.stencilFail).substr(3);
|
||||
pipe.m_StencilState.m_FrontFace.DepthFailOp = ToStr::Get(rs.StencilFront.depthFail).substr(3);
|
||||
pipe.m_StencilState.m_BackFace.ValueMask = rs.StencilBack.valuemask;
|
||||
pipe.m_StencilState.m_BackFace.WriteMask = rs.StencilBack.writemask;
|
||||
pipe.m_StencilState.m_BackFace.Ref = rs.StencilBack.ref;
|
||||
pipe.m_StencilState.m_BackFace.Func = ToStr::Get(rs.StencilBack.func).substr(3);
|
||||
pipe.m_StencilState.m_BackFace.PassOp = ToStr::Get(rs.StencilBack.pass).substr(3);
|
||||
pipe.m_StencilState.m_BackFace.FailOp = ToStr::Get(rs.StencilBack.stencilFail).substr(3);
|
||||
pipe.m_StencilState.m_BackFace.DepthFailOp = ToStr::Get(rs.StencilBack.depthFail).substr(3);
|
||||
|
||||
// Frame buffer
|
||||
|
||||
GLuint curFBO = 0;
|
||||
|
||||
@@ -152,6 +152,46 @@ namespace renderdoc
|
||||
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
|
||||
public Rasterizer m_RS;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class DepthState
|
||||
{
|
||||
public bool DepthEnable;
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string DepthFunc;
|
||||
public bool DepthWrites;
|
||||
public bool DepthBounds;
|
||||
public double NearBound;
|
||||
public double FarBound;
|
||||
};
|
||||
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
|
||||
public DepthState m_DepthState;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class StencilState
|
||||
{
|
||||
public bool StencilEnable;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class StencilOp
|
||||
{
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string FailOp;
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string DepthFailOp;
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string PassOp;
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string Func;
|
||||
public UInt32 Ref;
|
||||
public UInt32 ValueMask;
|
||||
public UInt32 WriteMask;
|
||||
};
|
||||
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
|
||||
public StencilOp m_FrontFace, m_BackFace;
|
||||
};
|
||||
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
|
||||
public StencilState m_StencilState;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class FrameBuffer
|
||||
{
|
||||
|
||||
@@ -153,6 +153,8 @@ namespace renderdocui.Windows.PipelineState
|
||||
stencilWriteMask.Text = "FF";
|
||||
stencilRef.Text = "FF";
|
||||
|
||||
stencilFuncs.Nodes.Clear();
|
||||
|
||||
pipeFlow.SetStagesEnabled(new bool[] { true, true, true, true, true, true, true, true, true });
|
||||
}
|
||||
|
||||
|
||||
+1025
-1104
File diff suppressed because it is too large
Load Diff
@@ -129,16 +129,16 @@ namespace renderdocui.Windows.PipelineState
|
||||
|
||||
blendFactor.Text = "0.00, 0.00, 0.00, 0.00";
|
||||
|
||||
sampleMask.Text = "FFFFFFFF";
|
||||
|
||||
depthEnable.Image = tick;
|
||||
depthFunc.Text = "GREATER_EQUAL";
|
||||
depthWrite.Image = tick;
|
||||
|
||||
depthBounds.Image = tick;
|
||||
depthBounds.Text = "0.000 - 1.000";
|
||||
|
||||
stencilEnable.Image = tick;
|
||||
stencilReadMask.Text = "FF";
|
||||
stencilWriteMask.Text = "FF";
|
||||
stencilRef.Text = "FF";
|
||||
|
||||
stencilFuncs.Nodes.Clear();
|
||||
|
||||
pipeFlow.SetStagesEnabled(new bool[] { true, true, true, true, true, true, true, true, true });
|
||||
}
|
||||
@@ -923,12 +923,21 @@ namespace renderdocui.Windows.PipelineState
|
||||
state.m_FB.m_BlendState.BlendFactor[2].ToString("F2") + ", " +
|
||||
state.m_FB.m_BlendState.BlendFactor[3].ToString("F2");
|
||||
|
||||
depthEnable.Image = state.m_DepthState.DepthEnable ? tick : cross;
|
||||
depthFunc.Text = state.m_DepthState.DepthFunc;
|
||||
depthWrite.Image = state.m_DepthState.DepthWrites ? tick : cross;
|
||||
|
||||
depthBounds.Image = state.m_DepthState.DepthBounds ? tick : cross;
|
||||
depthBounds.Text = String.Format("{0:F3} - {1:F3}", state.m_DepthState.NearBound, state.m_DepthState.FarBound);
|
||||
|
||||
stencilEnable.Image = state.m_StencilState.StencilEnable ? tick : cross;
|
||||
|
||||
stencilFuncs.BeginUpdate();
|
||||
stencilFuncs.Nodes.Clear();
|
||||
stencilFuncs.Nodes.Add(new object[] { "Front", "", "",
|
||||
"", "" });
|
||||
stencilFuncs.Nodes.Add(new object[] { "Back", "", "",
|
||||
"", "" });
|
||||
var sop = state.m_StencilState.m_FrontFace;
|
||||
stencilFuncs.Nodes.Add(new object[] { "Front", sop.Func, sop.FailOp, sop.DepthFailOp, sop.PassOp, sop.Ref, sop.WriteMask, sop.ValueMask });
|
||||
sop = state.m_StencilState.m_BackFace;
|
||||
stencilFuncs.Nodes.Add(new object[] { "Back", sop.Func, sop.FailOp, sop.DepthFailOp, sop.PassOp, sop.Ref, sop.WriteMask, sop.ValueMask });
|
||||
stencilFuncs.EndUpdate();
|
||||
stencilFuncs.NodesSelection.Clear();
|
||||
|
||||
|
||||
@@ -126,15 +126,6 @@
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>140, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>140, 17</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox44.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
@@ -144,21 +135,6 @@
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>239, 17</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox42.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label15.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label16.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label17.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="frontCCW.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
@@ -290,7 +266,4 @@
|
||||
<metadata name="rightclickMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>239, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Reference in New Issue
Block a user