mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 02:52:10 +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();
|
||||
|
||||
for (uint32_t i = 0; i < NumBuffers; i++) {
|
||||
if (ppVertexBuffers != nullptr)
|
||||
ppVertexBuffers[i] = m_state.ia.vertexBuffers[StartSlot + i].buffer.ref();
|
||||
const bool inRange = StartSlot + i < m_state.ia.vertexBuffers.size();
|
||||
|
||||
if (ppVertexBuffers != nullptr) {
|
||||
ppVertexBuffers[i] = inRange
|
||||
? m_state.ia.vertexBuffers[StartSlot + i].buffer.ref()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
if (pStrides != nullptr)
|
||||
pStrides[i] = m_state.ia.vertexBuffers[StartSlot + i].stride;
|
||||
if (pStrides != nullptr) {
|
||||
pStrides[i] = inRange
|
||||
? m_state.ia.vertexBuffers[StartSlot + i].stride
|
||||
: 0u;
|
||||
}
|
||||
|
||||
if (pOffsets != nullptr)
|
||||
pOffsets[i] = m_state.ia.vertexBuffers[StartSlot + i].offset;
|
||||
if (pOffsets != nullptr) {
|
||||
pOffsets[i] = inRange
|
||||
? m_state.ia.vertexBuffers[StartSlot + i].offset
|
||||
: 0u;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user