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

[d3d9] Ensure that the bound UP vertex buffer region is large enough

If the buffer size is less than (vertexCount * stride), the last vertex
may be considered out-of-bounds, even if all attributes are included in
the vertex.

Fixes #2131.
This commit is contained in:
Philip Rebohle 2021-06-30 03:01:34 +02:00 committed by Joshie
parent 6e4778cc81
commit 96f5641a7e

View File

@ -1090,7 +1090,7 @@ namespace dxvk {
}
inline uint32_t GetUPBufferSize(uint32_t vertexCount, uint32_t stride) {
return (vertexCount - 1) * stride + m_state.vertexDecl->GetSize();
return (vertexCount - 1) * stride + std::max(m_state.vertexDecl->GetSize(), stride);
}
inline void FillUPVertexBuffer(void* buffer, const void* userData, uint32_t dataSize, uint32_t bufferSize) {