1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 02:52:10 +01:00

[d3d11] Add range checking to UAV and render target methods

This commit is contained in:
Philip Rebohle 2021-04-21 13:11:51 +02:00
parent b51fd4d06c
commit 11a02831a9
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -2662,8 +2662,11 @@ namespace dxvk {
ID3D11UnorderedAccessView** ppUnorderedAccessViews) {
D3D10DeviceLock lock = LockContext();
for (uint32_t i = 0; i < NumUAVs; i++)
ppUnorderedAccessViews[i] = m_state.cs.unorderedAccessViews[StartSlot + i].ref();
for (uint32_t i = 0; i < NumUAVs; i++) {
ppUnorderedAccessViews[i] = StartSlot + i < m_state.cs.unorderedAccessViews.size()
? m_state.cs.unorderedAccessViews[StartSlot + i].ref()
: nullptr;
}
}
@ -2813,8 +2816,11 @@ namespace dxvk {
D3D10DeviceLock lock = LockContext();
if (ppRenderTargetViews != nullptr) {
for (UINT i = 0; i < NumViews; i++)
ppRenderTargetViews[i] = m_state.om.renderTargetViews[i].ref();
for (UINT i = 0; i < NumViews; i++) {
ppRenderTargetViews[i] = i < m_state.om.renderTargetViews.size()
? m_state.om.renderTargetViews[i].ref()
: nullptr;
}
}
if (ppDepthStencilView != nullptr)
@ -2834,8 +2840,11 @@ namespace dxvk {
D3D10DeviceLock lock = LockContext();
if (ppUnorderedAccessViews != nullptr) {
for (UINT i = 0; i < NumUAVs; i++)
ppUnorderedAccessViews[i] = m_state.ps.unorderedAccessViews[UAVStartSlot + i].ref();
for (UINT i = 0; i < NumUAVs; i++) {
ppUnorderedAccessViews[i] = UAVStartSlot + i < m_state.ps.unorderedAccessViews.size()
? m_state.ps.unorderedAccessViews[UAVStartSlot + i].ref()
: nullptr;
}
}
}