mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 11:52:12 +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:
parent
6e4778cc81
commit
96f5641a7e
@ -1090,7 +1090,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline uint32_t GetUPBufferSize(uint32_t vertexCount, uint32_t stride) {
|
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) {
|
inline void FillUPVertexBuffer(void* buffer, const void* userData, uint32_t dataSize, uint32_t bufferSize) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user