Stefan Dösinger : wined3d: Index buffer creation adjustments.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Feb 27 06:45:57 CST 2007
Module: wine
Branch: master
Commit: 74d2632756e83b581ea38525735fb7475aab57a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=74d2632756e83b581ea38525735fb7475aab57a4
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Feb 26 13:38:17 2007 +0100
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().
---
dlls/wined3d/device.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b1e9c2d..500a857 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -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));
More information about the wine-cvs
mailing list