Commit 74d26327 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Index buffer creation adjustments.

Index buffer creation changes the bound gl buffer, thus the state has to be dirtified, similar to locking. In an error case the function returned without calling LEAVE_GL().
parent 76ed11e1
......@@ -447,6 +447,11 @@ static void CreateIndexBufferVBO(IWineD3DDeviceImpl *This, IWineD3DIndexBufferIm
GLenum error, glUsage;
TRACE("Creating VBO for Index Buffer %p\n", object);
/* The following code will modify the ELEMENT_ARRAY_BUFFER binding, make sure it is
* restored on the next draw
*/
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
ENTER_GL();
while(glGetError());
......@@ -454,8 +459,7 @@ static void CreateIndexBufferVBO(IWineD3DDeviceImpl *This, IWineD3DIndexBufferIm
error = glGetError();
if(error != GL_NO_ERROR || object->vbo == 0) {
ERR("Creating a vbo failed, continueing without vbo for this buffer\n");
object->vbo = 0;
return;
goto out;
}
GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, object->vbo));
......
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