Fix array indexing crashes, ditch a lot of messing with UAV start slot

* The UAV array is provided as we expect it - with UAVs from 0 onwards
  even if their 'slots' are 4, 5, 6 etc or whatever. UAVStartSlot is
  the slot of the 0th UAV.
This commit is contained in:
baldurk
2015-02-27 14:07:58 +00:00
parent a50445781f
commit cca206a356
3 changed files with 7 additions and 8 deletions
+3
View File
@@ -203,6 +203,9 @@ struct D3D11PipelineState
struct OutputMerger
{
OutputMerger()
: UAVStartSlot(0), DepthReadOnly(false), StencilReadOnly(false) {}
struct DepthStencilState
{
DepthStencilState()
+3 -7
View File
@@ -594,11 +594,9 @@ namespace renderdocui.Code
{
if (IsLogD3D11)
{
ResourceId[] ret = new ResourceId[m_D3D11.m_OM.RenderTargets.Length];
for (int i = (int)m_D3D11.m_OM.UAVStartSlot; i < m_D3D11.m_OM.RenderTargets.Length; i++)
{
ret[i] = m_D3D11.m_OM.UAVs[i - m_D3D11.m_OM.UAVStartSlot].Resource;
}
ResourceId[] ret = new ResourceId[m_D3D11.m_OM.UAVs.Length];
for (int i = 0; i < m_D3D11.m_OM.UAVs.Length; i++)
ret[i] = m_D3D11.m_OM.UAVs[i].Resource;
return ret;
}
@@ -606,9 +604,7 @@ namespace renderdocui.Code
{
ResourceId[] ret = new ResourceId[m_GL.Images.Length];
for (int i = 0; i < m_GL.Images.Length; i++)
{
ret[i] = m_GL.Images[i].Resource;
}
return ret;
}
+1 -1
View File
@@ -101,7 +101,7 @@ namespace renderdocui.Windows
else if (Type == FollowType.ReadWriteRes)
{
if (index >= core.CurD3D11PipelineState.m_OM.UAVStartSlot)
view = core.CurD3D11PipelineState.m_OM.UAVs[index - core.CurD3D11PipelineState.m_OM.UAVStartSlot];
view = core.CurD3D11PipelineState.m_OM.UAVs[index];
}
else if (Type == FollowType.PSResource)
{