1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[d3d9] Disable instancing for non-indexed draws

This commit is contained in:
Robin Kertels 2022-12-31 01:47:43 +01:00 committed by Joshie
parent 3a84838ac4
commit 97a91c816f

View File

@ -2467,15 +2467,16 @@ namespace dxvk {
EmitCs([this,
cPrimType = PrimitiveType,
cPrimCount = PrimitiveCount,
cStartVertex = StartVertex,
cInstanceCount = GetInstanceCount()
cStartVertex = StartVertex
](DxvkContext* ctx) {
auto drawInfo = GenerateDrawInfo(cPrimType, cPrimCount, cInstanceCount);
uint32_t vertexCount = GetVertexCount(cPrimType, cPrimCount);
ApplyPrimitiveType(ctx, cPrimType);
// Tests on Windows show that D3D9 does not do non-indexed instanced draws.
ctx->draw(
drawInfo.vertexCount, drawInfo.instanceCount,
vertexCount, 1,
cStartVertex, 0);
});
@ -2547,17 +2548,16 @@ namespace dxvk {
EmitCs([this,
cBufferSlice = std::move(upSlice.slice),
cPrimType = PrimitiveType,
cPrimCount = PrimitiveCount,
cInstanceCount = GetInstanceCount(),
cStride = VertexStreamZeroStride
cStride = VertexStreamZeroStride,
cVertexCount = vertexCount
](DxvkContext* ctx) mutable {
auto drawInfo = GenerateDrawInfo(cPrimType, cPrimCount, cInstanceCount);
ApplyPrimitiveType(ctx, cPrimType);
// Tests on Windows show that D3D9 does not do non-indexed instanced draws.
ctx->bindVertexBuffer(0, std::move(cBufferSlice), cStride);
ctx->draw(
drawInfo.vertexCount, drawInfo.instanceCount,
cVertexCount, 1,
0, 0);
ctx->bindVertexBuffer(0, DxvkBufferSlice(), 0);
});
@ -2699,8 +2699,7 @@ namespace dxvk {
cVertexCount = VertexCount,
cStartIndex = SrcStartIndex,
cInstanceCount = GetInstanceCount(),
cBufferSlice = slice,
cIndexed = m_state.indices != nullptr
cBufferSlice = slice
](DxvkContext* ctx) mutable {
Rc<DxvkShader> shader = m_swvpEmulator.GetShaderModule(this, cDecl);