mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
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:
@@ -203,6 +203,9 @@ struct D3D11PipelineState
|
||||
|
||||
struct OutputMerger
|
||||
{
|
||||
OutputMerger()
|
||||
: UAVStartSlot(0), DepthReadOnly(false), StencilReadOnly(false) {}
|
||||
|
||||
struct DepthStencilState
|
||||
{
|
||||
DepthStencilState()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user