[1/12] WineD3D: WineD3D: Index buffer creation adjustments

Stefan Dösinger stefan at codeweavers.com
Mon Feb 26 06:38:17 CST 2007


-------------- next part --------------
From 27503fd893ddf7cc2e2239f4a8d23c427bd72c7a Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Fri, 23 Feb 2007 17:16:56 +0100
Subject: [PATCH] WineD3D: Index buffer creation adjustments

Index buffer creation changes the bound gl buffer, thus the state has to
be dirtified, simmilar 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));
-- 
1.4.4.3



More information about the wine-patches mailing list