Fixed dynamic index buffer offset.

This commit is contained in:
Branimir Karadžić 2015-01-23 17:27:15 -08:00
parent e419171d10
commit 938c1a0e92

View file

@ -2990,7 +2990,11 @@ namespace bgfx
BGFX_API_FUNC(void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices) ) 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) ) BGFX_API_FUNC(void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices) )