Store index format and topology in drawcall, to accommodate GL

* D3D11 just latches the state from the input assembler state into the
  drawcall when it's being added. GL stores the state per-draw.
This commit is contained in:
baldurk
2015-01-15 17:17:12 +00:00
parent b9f1b9820f
commit f013f6fd29
19 changed files with 190 additions and 262 deletions
+3 -23
View File
@@ -90,23 +90,6 @@ namespace renderdocui.Code
}
}
public PrimitiveTopology DrawTopology
{
get
{
if (LogLoaded)
{
if (IsLogD3D11)
return m_D3D11.m_IA.Topology;
if (IsLogGL)
return m_GL.m_VtxIn.Topology;
}
return PrimitiveTopology.Unknown;
}
}
// there's a lot of redundancy in these functions
public ShaderBindpointMapping GetBindpointMapping(ShaderStageType stage)
@@ -241,7 +224,7 @@ namespace renderdocui.Code
return "";
}
public void GetIBuffer(out ResourceId buf, out uint ByteOffset, out ResourceFormat IndexFormat)
public void GetIBuffer(out ResourceId buf, out uint ByteOffset)
{
if (LogLoaded)
{
@@ -249,15 +232,13 @@ namespace renderdocui.Code
{
buf = m_D3D11.m_IA.ibuffer.Buffer;
ByteOffset = m_D3D11.m_IA.ibuffer.Offset;
IndexFormat = m_D3D11.m_IA.ibuffer.Format;
return;
}
else if (IsLogGL)
{
buf = m_GL.m_VtxIn.ibuffer.Buffer;
ByteOffset = m_GL.m_VtxIn.ibuffer.Offset;
IndexFormat = m_GL.m_VtxIn.ibuffer.Format;
buf = m_GL.m_VtxIn.ibuffer;
ByteOffset = 0; // GL only has per-draw index offset
return;
}
@@ -265,7 +246,6 @@ namespace renderdocui.Code
buf = ResourceId.Null;
ByteOffset = 0;
IndexFormat = new ResourceFormat(FormatComponentType.UInt, 1, 2);
}
public struct VBuffer