diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 5d4b4e278..c22bdce42 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -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; + } } }