From 5cd313e342531b34cacd39b0b622f1bc20484505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 8 Apr 2015 23:25:17 -0700 Subject: [PATCH] Cleanup. --- src/renderer_d3d11.cpp | 10 ++++++---- src/renderer_d3d9.cpp | 6 +++--- src/renderer_gl.cpp | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 6f502e53..cb6b6c76 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -3379,7 +3379,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); } else { - srv[ii] = texture.m_srv; + srv[ii] = texture.m_srv; sampler[ii] = texture.m_sampler; } } @@ -3727,10 +3727,12 @@ BX_PRAGMA_DIAGNOSTIC_POP(); { if (UINT32_MAX == draw.m_numIndices) { - numIndices = m_indexBuffers[draw.m_indexBuffer.idx].m_size/2; + const IndexBufferD3D11& ib = m_indexBuffers[draw.m_indexBuffer.idx]; + const uint32_t indexSize = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4; + numIndices = ib.m_size/indexSize; numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; + numInstances = draw.m_numInstances; + numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; deviceCtx->DrawIndexedInstanced(numIndices , draw.m_numInstances diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 7c1db097..44863b69 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -3347,10 +3347,10 @@ namespace bgfx { namespace d3d9 { const IndexBufferD3D9& ib = m_indexBuffers[draw.m_indexBuffer.idx]; const uint32_t indexSize = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4; - numIndices = ib.m_size/indexSize; + numIndices = ib.m_size/indexSize; numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; + numInstances = draw.m_numInstances; + numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; DX_CHECK(device->DrawIndexedPrimitive(prim.m_type , draw.m_startVertex diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 19d20e9e..1f5f3b6a 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -5274,10 +5274,10 @@ namespace bgfx { namespace gl if (UINT32_MAX == draw.m_numIndices) { const uint32_t indexSize = hasIndex16 ? 2 : 4; - numIndices = ib.m_size/indexSize; + numIndices = ib.m_size/indexSize; numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub; - numInstances = draw.m_numInstances; - numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; + numInstances = draw.m_numInstances; + numPrimsRendered = numPrimsSubmitted*draw.m_numInstances; GL_CHECK(glDrawElementsInstanced(prim.m_type , numIndices