meta: Fix the BufferSubData in meta clear to be BufferData.
authorEric Anholt <eric@anholt.net>
Tue, 20 Oct 2009 00:54:42 +0000 (17:54 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 20 Oct 2009 20:07:49 +0000 (13:07 -0700)
Fixes a 3.4% +/- 1.3% performance regression in my GL demo (n=3).  The
other meta code could probably also use the same treatment.

src/mesa/drivers/common/meta.c

index ceb929f694f25665ea2efabf5e4bcfed33a4ba57..b38f22e130ec504e914cd5ac92a8c3e12c82ae1b 100644 (file)
@@ -1346,8 +1346,6 @@ _mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers)
       /* create vertex array buffer */
       _mesa_GenBuffersARB(1, &clear->VBO);
       _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, clear->VBO);
-      _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts),
-                          NULL, GL_DYNAMIC_DRAW_ARB);
 
       /* setup vertex arrays */
       _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x));
@@ -1423,7 +1421,8 @@ _mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers)
       }
 
       /* upload new vertex data */
-      _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);
+      _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts,
+                         GL_DYNAMIC_DRAW_ARB);
    }
 
    /* draw quad */