Commit 850bd7b4 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Restore the index buffer when switching from UP to buffer drawing.

The state handler binds index buffer 0 when a user pointer is used. Likewise the real index buffer has to be restored when switching back to drawing from index buffers.
parent 39fb7839
...@@ -4250,12 +4250,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, WI ...@@ -4250,12 +4250,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitive(IWineD3DDevice *iface, WI
UINT PrimitiveCount) { UINT PrimitiveCount) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
This->stateBlock->streamIsUP = FALSE;
TRACE("(%p) : Type=(%d,%s), Start=%d, Count=%d\n", This, PrimitiveType, TRACE("(%p) : Type=(%d,%s), Start=%d, Count=%d\n", This, PrimitiveType,
debug_d3dprimitivetype(PrimitiveType), debug_d3dprimitivetype(PrimitiveType),
StartVertex, PrimitiveCount); StartVertex, PrimitiveCount);
/* The index buffer is not needed here, but restore it, otherwise it is hell to keep track of */
if(This->stateBlock->streamIsUP) {
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
This->stateBlock->streamIsUP = FALSE;
}
if(This->stateBlock->loadBaseVertexIndex != 0) { if(This->stateBlock->loadBaseVertexIndex != 0) {
This->stateBlock->loadBaseVertexIndex = 0; This->stateBlock->loadBaseVertexIndex = 0;
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC); IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
...@@ -4277,8 +4282,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice * ...@@ -4277,8 +4282,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *
WINED3DINDEXBUFFER_DESC IdxBufDsc; WINED3DINDEXBUFFER_DESC IdxBufDsc;
GLuint vbo; GLuint vbo;
pIB = This->stateBlock->pIndexData; if(This->stateBlock->streamIsUP) {
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
This->stateBlock->streamIsUP = FALSE; This->stateBlock->streamIsUP = FALSE;
}
pIB = This->stateBlock->pIndexData;
vbo = ((IWineD3DIndexBufferImpl *) pIB)->vbo; vbo = ((IWineD3DIndexBufferImpl *) pIB)->vbo;
TRACE("(%p) : Type=(%d,%s), min=%d, CountV=%d, startIdx=%d, countP=%d\n", This, TRACE("(%p) : Type=(%d,%s), min=%d, CountV=%d, startIdx=%d, countP=%d\n", This,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment