1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[d3d9] Dont use GenerateDrawInfo in DrawPrimitiveUp

This is confusing because it looks like a race condition
at first glance.
This commit is contained in:
Robin Kertels 2022-12-30 20:12:37 +01:00 committed by Joshie
parent 12901b52f1
commit f94b42f23f

View File

@ -2536,10 +2536,10 @@ namespace dxvk {
PrepareDraw(PrimitiveType);
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount);
const uint32_t dataSize = GetUPDataSize(drawInfo.vertexCount, VertexStreamZeroStride);
const uint32_t bufferSize = GetUPBufferSize(drawInfo.vertexCount, VertexStreamZeroStride);
const uint32_t dataSize = GetUPDataSize(vertexCount, VertexStreamZeroStride);
const uint32_t bufferSize = GetUPBufferSize(vertexCount, VertexStreamZeroStride);
auto upSlice = AllocUPBuffer(bufferSize);
FillUPVertexBuffer(upSlice.mapPtr, pVertexStreamZeroData, dataSize, bufferSize);
@ -2589,13 +2589,13 @@ namespace dxvk {
PrepareDraw(PrimitiveType);
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount);
const uint32_t vertexDataSize = GetUPDataSize(MinVertexIndex + NumVertices, VertexStreamZeroStride);
const uint32_t vertexBufferSize = GetUPBufferSize(MinVertexIndex + NumVertices, VertexStreamZeroStride);
const uint32_t indexSize = IndexDataFormat == D3DFMT_INDEX16 ? 2 : 4;
const uint32_t indicesSize = drawInfo.vertexCount * indexSize;
const uint32_t indicesSize = vertexCount * indexSize;
const uint32_t upSize = vertexBufferSize + indicesSize;