diff --git a/src/bgfx_p.h b/src/bgfx_p.h index f2bdf1a0..73fd296d 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -2990,7 +2990,11 @@ namespace bgfx BGFX_API_FUNC(void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices) ) { - m_submit->setIndexBuffer(m_dynamicIndexBuffers[_handle.idx].m_handle, _firstIndex, _numIndices); + const DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx]; + m_submit->setIndexBuffer(dib.m_handle + , dib.m_offset / 2 + _firstIndex * 2 + , _numIndices + ); } BGFX_API_FUNC(void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices) )