mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Fixed issue #447.
This commit is contained in:
parent
b166bc8f1b
commit
6c48b12a3f
1 changed files with 2 additions and 2 deletions
|
@ -5707,6 +5707,7 @@ namespace bgfx { namespace gl
|
|||
{
|
||||
const IndexBufferGL& ib = m_indexBuffers[draw.m_indexBuffer.idx];
|
||||
const bool hasIndex16 = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32);
|
||||
const uint32_t indexSize = hasIndex16 ? 2 : 4;
|
||||
const GLenum indexFormat = hasIndex16
|
||||
? GL_UNSIGNED_SHORT
|
||||
: GL_UNSIGNED_INT
|
||||
|
@ -5714,7 +5715,6 @@ namespace bgfx { namespace gl
|
|||
|
||||
if (UINT32_MAX == draw.m_numIndices)
|
||||
{
|
||||
const uint32_t indexSize = hasIndex16 ? 2 : 4;
|
||||
numIndices = ib.m_size/indexSize;
|
||||
numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub;
|
||||
numInstances = draw.m_numInstances;
|
||||
|
@ -5737,7 +5737,7 @@ namespace bgfx { namespace gl
|
|||
GL_CHECK(glDrawElementsInstanced(prim.m_type
|
||||
, numIndices
|
||||
, indexFormat
|
||||
, (void*)(uintptr_t)(draw.m_startIndex*2)
|
||||
, (void*)(uintptr_t)(draw.m_startIndex*indexSize)
|
||||
, draw.m_numInstances
|
||||
) );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue