diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 2fa8fbc1..6cc8ad7e 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -1845,8 +1845,8 @@ namespace bgfx void TextVideoMemBlitter::render(uint32_t _numIndices) { uint32_t numVertices = _numIndices*4/6; - s_renderCtx.m_indexBuffers[m_ib->handle.idx].update(0, _numIndices*2, m_ib->data); - s_renderCtx.m_vertexBuffers[m_vb->handle.idx].update(0, numVertices*m_decl.m_stride, m_vb->data); + s_renderCtx.m_indexBuffers[m_ib->handle.idx].update(0, _numIndices*2, m_ib->data, true); + s_renderCtx.m_vertexBuffers[m_vb->handle.idx].update(0, numVertices*m_decl.m_stride, m_vb->data, true); DX_CHECK(s_renderCtx.m_device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST , 0 @@ -2028,13 +2028,13 @@ namespace bgfx if (0 < m_render->m_iboffset) { TransientIndexBuffer* ib = m_render->m_transientIb; - s_renderCtx.m_indexBuffers[ib->handle.idx].update(0, m_render->m_iboffset, ib->data); + s_renderCtx.m_indexBuffers[ib->handle.idx].update(0, m_render->m_iboffset, ib->data, true); } if (0 < m_render->m_vboffset) { TransientVertexBuffer* vb = m_render->m_transientVb; - s_renderCtx.m_vertexBuffers[vb->handle.idx].update(0, m_render->m_vboffset, vb->data); + s_renderCtx.m_vertexBuffers[vb->handle.idx].update(0, m_render->m_vboffset, vb->data, true); } m_render->sort(); diff --git a/src/renderer_d3d9.h b/src/renderer_d3d9.h index 191a92f5..9b9e6bb4 100644 --- a/src/renderer_d3d9.h +++ b/src/renderer_d3d9.h @@ -148,13 +148,13 @@ namespace bgfx } void create(uint32_t _size, void* _data); - void update(uint32_t _offset, uint32_t _size, void* _data) + void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false) { void* buffer; DX_CHECK(m_ptr->Lock(_offset , _size , &buffer - , m_dynamic && 0 == _offset && m_size == _size ? D3DLOCK_DISCARD : 0 + , _discard || (m_dynamic && 0 == _offset && m_size == _size) ? D3DLOCK_DISCARD : 0 ) ); memcpy(buffer, _data, _size); @@ -188,13 +188,13 @@ namespace bgfx } void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle); - void update(uint32_t _offset, uint32_t _size, void* _data) + void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false) { void* buffer; DX_CHECK(m_ptr->Lock(_offset , _size , &buffer - , m_dynamic && 0 == _offset && m_size == _size ? D3DLOCK_DISCARD : 0 + , _discard || (m_dynamic && 0 == _offset && m_size == _size) ? D3DLOCK_DISCARD : 0 ) ); memcpy(buffer, _data, _size);