Stefan Dösinger : wined3d: Fix VBO buffer usage.

Alexandre Julliard julliard at winehq.org
Wed Dec 16 09:41:36 CST 2009


Module: wine
Branch: master
Commit: 8eeb513b1a0e7a4f7963612f0305850499c9ec7d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8eeb513b1a0e7a4f7963612f0305850499c9ec7d

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sat Nov 28 11:38:29 2009 +0100

wined3d: Fix VBO buffer usage.

---

 dlls/wined3d/buffer.c |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index f6e89dd..ff1ebd7 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -79,22 +79,17 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This)
     }
 
     /* Don't use static, because dx apps tend to update the buffer
-    * quite often even if they specify 0 usage. Because we always keep the local copy
-    * we never read from the vbo and can create a write only opengl buffer.
-    */
-    switch(This->resource.usage & (WINED3DUSAGE_WRITEONLY | WINED3DUSAGE_DYNAMIC))
+     * quite often even if they specify 0 usage.
+     */
+    if(This->resource.usage & WINED3DUSAGE_DYNAMIC)
+    {
+        TRACE("Gl usage = GL_DYNAMIC_DRAW\n");
+        gl_usage = GL_DYNAMIC_DRAW_ARB;
+    }
+    else
     {
-        case WINED3DUSAGE_WRITEONLY | WINED3DUSAGE_DYNAMIC:
-        case WINED3DUSAGE_DYNAMIC:
-            TRACE("Gl usage = GL_STREAM_DRAW\n");
-            gl_usage = GL_STREAM_DRAW_ARB;
-            break;
-
-        case WINED3DUSAGE_WRITEONLY:
-        default:
-            TRACE("Gl usage = GL_DYNAMIC_DRAW\n");
-            gl_usage = GL_DYNAMIC_DRAW_ARB;
-            break;
+        TRACE("Gl usage = GL_STREAM_DRAW\n");
+        gl_usage = GL_STREAM_DRAW_ARB;
     }
 
     /* Reserve memory for the buffer. The amount of data won't change




More information about the wine-cvs mailing list