[Mesa-dev] [PATCH 3/5] corresponding cleanup for patch 11: Optimize rebinding the same VBO

Eric Anholt eric at anholt.net
Thu Oct 31 19:50:22 CET 2013


---
 src/mesa/main/varray.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index e7ff8d7..0087096 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1347,10 +1347,10 @@ void GLAPIENTRY
 _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
                        GLsizei stride)
 {
+   GET_CURRENT_CONTEXT(ctx);
+   const struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
    struct gl_buffer_object *vbo;
-   struct gl_vertex_buffer_binding *binding;
 
-   GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    /* The ARB_vertex_attrib_binding spec says:
@@ -1395,10 +1395,8 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
       return;
    }
 
-   binding = gl_vertex_buffer_binding(ctx, VERT_ATTRIB_GENERIC(bindingIndex));
-
-   if (buffer == binding->BufferObj->Name) {
-      vbo = binding->BufferObj;
+   if (buffer == arrayObj->VertexBinding[bindingIndex].BufferObj->Name) {
+      vbo = arrayObj->VertexBinding[bindingIndex].BufferObj;
    } else if (buffer != 0) {
       vbo = _mesa_lookup_bufferobj(ctx, buffer);
 
-- 
1.8.4.rc3



More information about the mesa-dev mailing list