Skip to content

Commit dc96853

Browse files
committed
Look up constant buffers properly via shader details in D3D11. Refs baldurk#411
1 parent 94eb512 commit dc96853

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

renderdocui/Code/CommonPipelineState.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -943,13 +943,18 @@ public void GetConstantBuffer(ShaderStageType stage, uint BufIdx, uint ArrayIdx,
943943
case ShaderStageType.Compute: s = m_D3D11.m_CS; break;
944944
}
945945

946-
if(BufIdx < s.ConstantBuffers.Length)
946+
if (s.ShaderDetails != null && BufIdx < s.ShaderDetails.ConstantBlocks.Length)
947947
{
948-
buf = s.ConstantBuffers[BufIdx].Buffer;
949-
ByteOffset = (ulong)(s.ConstantBuffers[BufIdx].VecOffset * 4 * sizeof(float));
950-
ByteSize = (ulong)(s.ConstantBuffers[BufIdx].VecCount * 4 * sizeof(float));
948+
int bind = s.ShaderDetails.ConstantBlocks[BufIdx].bindPoint;
951949

952-
return;
950+
if (bind < s.ConstantBuffers.Length)
951+
{
952+
buf = s.ConstantBuffers[bind].Buffer;
953+
ByteOffset = (ulong)(s.ConstantBuffers[bind].VecOffset * 4 * sizeof(float));
954+
ByteSize = (ulong)(s.ConstantBuffers[bind].VecCount * 4 * sizeof(float));
955+
956+
return;
957+
}
953958
}
954959
}
955960
else if (IsLogD3D12)

0 commit comments

Comments
 (0)