Vertex buffer fixes (#2458)

* Vulkan: calculate vertex count from all streams, not just the first

...which might not exist in the first place

* Vulkan: use correct vertex stream offsets and handles

* D3D11: remember stream vertex count when no index buffer is bound
This commit is contained in:
pezcode
2021-04-08 19:28:42 +02:00
committed by GitHub
parent 9ec2472763
commit b298851bf0
2 changed files with 27 additions and 20 deletions

View File

@@ -5561,6 +5561,8 @@ namespace bgfx { namespace d3d11
currentState.m_stateFlags = BGFX_STATE_NONE;
currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE);
uint32_t currentNumVertices = 0;
RenderBind currentBind;
currentBind.clear();
@@ -6191,6 +6193,8 @@ namespace bgfx { namespace d3d11
}
}
currentNumVertices = numVertices;
if (0 < numStreams)
{
deviceCtx->IASetVertexBuffers(0, numStreams, buffers, strides, offsets);
@@ -6249,7 +6253,7 @@ namespace bgfx { namespace d3d11
if (0 != currentState.m_streamMask)
{
uint32_t numVertices = draw.m_numVertices;
uint32_t numVertices = currentNumVertices;
uint32_t numIndices = 0;
uint32_t numPrimsSubmitted = 0;
uint32_t numInstances = 0;