Skip to content

Commit

Permalink
Fix array indexing crashes, ditch a lot of messing with UAV start slot
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
baldurk committed Feb 27, 2015
1 parent a504457 commit cca206a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 3 additions & 0 deletions renderdoc/api/replay/d3d11_pipestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ struct D3D11PipelineState

struct OutputMerger
{
OutputMerger()
: UAVStartSlot(0), DepthReadOnly(false), StencilReadOnly(false) {}

struct DepthStencilState
{
DepthStencilState()
Expand Down
10 changes: 3 additions & 7 deletions renderdocui/Code/CommonPipelineState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,21 +594,17 @@ public ResourceId[] GetReadWriteResources()
{
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;
}
else if (IsLogGL)
{
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;
}
Expand Down
2 changes: 1 addition & 1 deletion renderdocui/Windows/TextureViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public UInt32 GetFirstArraySlice(Core core)
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)
{
Expand Down

0 comments on commit cca206a

Please sign in to comment.