mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 11:52:11 +01:00
[d3d11] Add range checking to IAGetVertexBuffers
This commit is contained in:
parent
a13dad07cc
commit
b51fd4d06c
@ -1708,14 +1708,25 @@ namespace dxvk {
|
|||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < NumBuffers; i++) {
|
for (uint32_t i = 0; i < NumBuffers; i++) {
|
||||||
if (ppVertexBuffers != nullptr)
|
const bool inRange = StartSlot + i < m_state.ia.vertexBuffers.size();
|
||||||
ppVertexBuffers[i] = m_state.ia.vertexBuffers[StartSlot + i].buffer.ref();
|
|
||||||
|
if (ppVertexBuffers != nullptr) {
|
||||||
|
ppVertexBuffers[i] = inRange
|
||||||
|
? m_state.ia.vertexBuffers[StartSlot + i].buffer.ref()
|
||||||
|
: nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (pStrides != nullptr)
|
if (pStrides != nullptr) {
|
||||||
pStrides[i] = m_state.ia.vertexBuffers[StartSlot + i].stride;
|
pStrides[i] = inRange
|
||||||
|
? m_state.ia.vertexBuffers[StartSlot + i].stride
|
||||||
|
: 0u;
|
||||||
|
}
|
||||||
|
|
||||||
if (pOffsets != nullptr)
|
if (pOffsets != nullptr) {
|
||||||
pOffsets[i] = m_state.ia.vertexBuffers[StartSlot + i].offset;
|
pOffsets[i] = inRange
|
||||||
|
? m_state.ia.vertexBuffers[StartSlot + i].offset
|
||||||
|
: 0u;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user