Stefan Dösinger : wined3d: Do not try to create a vbo more than once.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jul 21 13:49:22 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 9423fd2d9fb8d4def3d86be8466c80641034811f
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=9423fd2d9fb8d4def3d86be8466c80641034811f

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Jul 21 14:02:44 2006 +0200

wined3d: Do not try to create a vbo more than once.

---

 dlls/wined3d/device.c          |    6 ++++++
 dlls/wined3d/wined3d_private.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 53c4986..2f41216 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -611,6 +611,11 @@ static void CreateVBO(IWineD3DVertexBuff
     IWineD3DDeviceImpl *This = object->resource.wineD3DDevice;  /* Needed for GL_EXTCALL */
     GLenum error, glUsage;
     DWORD vboUsage = object->resource.usage;
+    if(object->Flags & VBFLAG_VBOCREATEFAIL) {
+        WARN("Creating a vbo failed once, not trying again\n");
+        return;
+    }
+
     TRACE("Creating an OpenGL vertex buffer object for IWineD3DVertexBuffer %p\n", object);
 
     ENTER_GL();
@@ -694,6 +699,7 @@ static void CreateVBO(IWineD3DVertexBuff
     FIXME("Failed to create a vertex buffer object. Continuing, but performance issues can occur\n");
     if(object->vbo) GL_EXTCALL(glDeleteBuffersARB(1, &object->vbo));
     object->vbo = 0;
+    object->Flags |= VBFLAG_VBOCREATEFAIL;
     LEAVE_GL();
     return;
 }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index daedc52..dc0644d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -654,6 +654,7 @@ #define VBFLAG_OPTIMIZED      0x02    /*
 #define VBFLAG_DIRTY          0x04    /* Buffer data has been modified */
 #define VBFLAG_STREAM         0x08    /* The vertex buffer is in a stream */
 #define VBFLAG_HASDESC        0x10    /* A vertex description has been found */
+#define VBFLAG_VBOCREATEFAIL  0x20    /* An attempt to create a vbo has failed */
 
 /*****************************************************************************
  * IWineD3DIndexBuffer implementation structure (extends IWineD3DResourceImpl)




More information about the wine-cvs mailing list