[Mesa-dev] [PATCH 15/22] mesa: Add a vao parameter to vertex_binding_divisor

Fredrik Höglund fredrik at kde.org
Wed Mar 18 16:18:41 PDT 2015


This is needed to implement VertexArrayBindingDivisor.
---
 src/mesa/main/varray.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 6cfe240..c9a328b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -184,10 +184,11 @@ bind_vertex_buffer(struct gl_context *ctx,
  * given by bindingIndex.
  */
 static void
-vertex_binding_divisor(struct gl_context *ctx, GLuint bindingIndex,
+vertex_binding_divisor(struct gl_context *ctx,
+                       struct gl_vertex_array_object *vao,
+                       GLuint bindingIndex,
                        GLuint divisor)
 {
-   struct gl_vertex_array_object *vao = ctx->Array.VAO;
    struct gl_vertex_buffer_binding *binding =
       &vao->VertexBinding[bindingIndex];
 
@@ -1436,7 +1437,7 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
     *       VertexBindingDivisor(index, divisor);"
     */
    vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
-   vertex_binding_divisor(ctx, genericIndex, divisor);
+   vertex_binding_divisor(ctx, vao, genericIndex, divisor);
 }
 
 
@@ -2031,7 +2032,8 @@ _mesa_VertexBindingDivisor(GLuint bindingIndex, GLuint divisor)
       return;
    }
 
-   vertex_binding_divisor(ctx, VERT_ATTRIB_GENERIC(bindingIndex), divisor);
+   vertex_binding_divisor(ctx, ctx->Array.VAO,
+                          VERT_ATTRIB_GENERIC(bindingIndex), divisor);
 }
 
 
-- 
1.8.5.3



More information about the mesa-dev mailing list