glthread: rename non_vbo_attrib_mask -> user_buffer_mask, attribs -> buffers
authorMarek Olšák <marek.olsak@amd.com>
Sun, 31 May 2020 02:39:54 +0000 (22:39 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 23 Jun 2020 06:41:37 +0000 (06:41 +0000)
just a cleanup, no change in behavior

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5303>

src/mesa/main/glthread_draw.c
src/mesa/main/varray.c
src/mesa/main/varray.h

index 7c41496e4e0b3ed721a9bb8030c869ea975d09f7..ed27cb14bff3f03a1c7032701342bfbd446a6a0a 100644 (file)
@@ -107,17 +107,17 @@ upload_multi_indices(struct gl_context *ctx, unsigned total_count,
 }
 
 static ALWAYS_INLINE bool
-upload_vertices(struct gl_context *ctx, unsigned attrib_mask,
+upload_vertices(struct gl_context *ctx, unsigned user_buffer_mask,
                 unsigned start_vertex, unsigned num_vertices,
                 unsigned start_instance, unsigned num_instances,
-                struct glthread_attrib_binding *attribs)
+                struct glthread_attrib_binding *buffers)
 {
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
-   unsigned attrib_mask_iter = attrib_mask;
-   unsigned num_attribs = 0;
+   unsigned attrib_mask_iter = user_buffer_mask;
+   unsigned num_buffers = 0;
 
-   assert((num_vertices || !(attrib_mask & ~vao->NonZeroDivisorMask)) &&
-          (num_instances || !(attrib_mask & vao->NonZeroDivisorMask)));
+   assert((num_vertices || !(user_buffer_mask & ~vao->NonZeroDivisorMask)) &&
+          (num_instances || !(user_buffer_mask & vao->NonZeroDivisorMask)));
 
    while (attrib_mask_iter) {
       unsigned i = u_bit_scan(&attrib_mask_iter);
@@ -153,10 +153,10 @@ upload_vertices(struct gl_context *ctx, unsigned attrib_mask,
                             size, &upload_offset, &upload_buffer, NULL);
       assert(upload_buffer);
 
-      attribs[num_attribs].buffer = upload_buffer;
-      attribs[num_attribs].offset = upload_offset - offset;
-      attribs[num_attribs].original_pointer = ptr;
-      num_attribs++;
+      buffers[num_buffers].buffer = upload_buffer;
+      buffers[num_buffers].offset = upload_offset - offset;
+      buffers[num_buffers].original_pointer = ptr;
+      num_buffers++;
    }
    return true;
 }
@@ -169,7 +169,7 @@ struct marshal_cmd_DrawArraysInstancedBaseInstance
    GLsizei count;
    GLsizei instance_count;
    GLuint baseinstance;
-   GLuint non_vbo_attrib_mask;
+   GLuint user_buffer_mask;
 };
 
 void
@@ -181,13 +181,13 @@ _mesa_unmarshal_DrawArraysInstancedBaseInstance(struct gl_context *ctx,
    const GLsizei count = cmd->count;
    const GLsizei instance_count = cmd->instance_count;
    const GLuint baseinstance = cmd->baseinstance;
-   const GLuint non_vbo_attrib_mask = cmd->non_vbo_attrib_mask;
-   const struct glthread_attrib_binding *attribs =
+   const GLuint user_buffer_mask = cmd->user_buffer_mask;
+   const struct glthread_attrib_binding *buffers =
       (const struct glthread_attrib_binding *)(cmd + 1);
 
    /* Bind uploaded buffers if needed. */
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       false);
    }
 
@@ -196,8 +196,8 @@ _mesa_unmarshal_DrawArraysInstancedBaseInstance(struct gl_context *ctx,
                                          baseinstance));
 
    /* Restore states. */
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       true);
    }
 }
@@ -205,12 +205,12 @@ _mesa_unmarshal_DrawArraysInstancedBaseInstance(struct gl_context *ctx,
 static ALWAYS_INLINE void
 draw_arrays_async(struct gl_context *ctx, GLenum mode, GLint first,
                   GLsizei count, GLsizei instance_count, GLuint baseinstance,
-                  unsigned non_vbo_attrib_mask,
-                  const struct glthread_attrib_binding *attribs)
+                  unsigned user_buffer_mask,
+                  const struct glthread_attrib_binding *buffers)
 {
-   int attribs_size = util_bitcount(non_vbo_attrib_mask) * sizeof(attribs[0]);
+   int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
    int cmd_size = sizeof(struct marshal_cmd_DrawArraysInstancedBaseInstance) +
-                  attribs_size;
+                  buffers_size;
    struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd;
 
    cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysInstancedBaseInstance,
@@ -220,10 +220,10 @@ draw_arrays_async(struct gl_context *ctx, GLenum mode, GLint first,
    cmd->count = count;
    cmd->instance_count = instance_count;
    cmd->baseinstance = baseinstance;
-   cmd->non_vbo_attrib_mask = non_vbo_attrib_mask;
+   cmd->user_buffer_mask = user_buffer_mask;
 
-   if (non_vbo_attrib_mask)
-      memcpy(cmd + 1, attribs, attribs_size);
+   if (user_buffer_mask)
+      memcpy(cmd + 1, buffers, buffers_size);
 }
 
 static ALWAYS_INLINE void
@@ -233,7 +233,7 @@ draw_arrays(GLenum mode, GLint first, GLsizei count, GLsizei instance_count,
    GET_CURRENT_CONTEXT(ctx);
 
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
-   unsigned non_vbo_attrib_mask = vao->UserPointerMask & vao->Enabled;
+   unsigned user_buffer_mask = vao->UserPointerMask & vao->Enabled;
 
    if (compiled_into_dlist && ctx->GLThread.inside_dlist) {
       _mesa_glthread_finish_before(ctx, "DrawArrays");
@@ -247,7 +247,7 @@ draw_arrays(GLenum mode, GLint first, GLsizei count, GLsizei instance_count,
     * This is also an error path. Zero counts should still call the driver
     * for possible GL errors.
     */
-   if (ctx->API == API_OPENGL_CORE || !non_vbo_attrib_mask ||
+   if (ctx->API == API_OPENGL_CORE || !user_buffer_mask ||
        count <= 0 || instance_count <= 0) {
       draw_arrays_async(ctx, mode, first, count, instance_count, baseinstance,
                         0, NULL);
@@ -255,10 +255,10 @@ draw_arrays(GLenum mode, GLint first, GLsizei count, GLsizei instance_count,
    }
 
    /* Upload and draw. */
-   struct glthread_attrib_binding attribs[VERT_ATTRIB_MAX];
+   struct glthread_attrib_binding buffers[VERT_ATTRIB_MAX];
    if (!ctx->GLThread.SupportsNonVBOUploads ||
-       !upload_vertices(ctx, non_vbo_attrib_mask, first, count, baseinstance,
-                        instance_count, attribs)) {
+       !upload_vertices(ctx, user_buffer_mask, first, count, baseinstance,
+                        instance_count, buffers)) {
       _mesa_glthread_finish_before(ctx, "DrawArrays");
       CALL_DrawArraysInstancedBaseInstance(ctx->CurrentServerDispatch,
                                            (mode, first, count, instance_count,
@@ -267,7 +267,7 @@ draw_arrays(GLenum mode, GLint first, GLsizei count, GLsizei instance_count,
    }
 
    draw_arrays_async(ctx, mode, first, count, instance_count, baseinstance,
-                     non_vbo_attrib_mask, attribs);
+                     user_buffer_mask, buffers);
 }
 
 struct marshal_cmd_MultiDrawArrays
@@ -275,7 +275,7 @@ struct marshal_cmd_MultiDrawArrays
    struct marshal_cmd_base cmd_base;
    GLenum mode;
    GLsizei draw_count;
-   GLuint non_vbo_attrib_mask;
+   GLuint user_buffer_mask;
 };
 
 void
@@ -284,19 +284,19 @@ _mesa_unmarshal_MultiDrawArrays(struct gl_context *ctx,
 {
    const GLenum mode = cmd->mode;
    const GLsizei draw_count = cmd->draw_count;
-   const GLuint non_vbo_attrib_mask = cmd->non_vbo_attrib_mask;
+   const GLuint user_buffer_mask = cmd->user_buffer_mask;
 
    const char *variable_data = (const char *)(cmd + 1);
    const GLint *first = (GLint *)variable_data;
    variable_data += sizeof(GLint) * draw_count;
    const GLsizei *count = (GLsizei *)variable_data;
    variable_data += sizeof(GLsizei) * draw_count;
-   const struct glthread_attrib_binding *attribs =
+   const struct glthread_attrib_binding *buffers =
       (const struct glthread_attrib_binding *)variable_data;
 
    /* Bind uploaded buffers if needed. */
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       false);
    }
 
@@ -304,8 +304,8 @@ _mesa_unmarshal_MultiDrawArrays(struct gl_context *ctx,
                         (mode, first, count, draw_count));
 
    /* Restore states. */
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       true);
    }
 }
@@ -313,30 +313,30 @@ _mesa_unmarshal_MultiDrawArrays(struct gl_context *ctx,
 static ALWAYS_INLINE void
 multi_draw_arrays_async(struct gl_context *ctx, GLenum mode,
                         const GLint *first, const GLsizei *count,
-                        GLsizei draw_count, unsigned non_vbo_attrib_mask,
-                        const struct glthread_attrib_binding *attribs)
+                        GLsizei draw_count, unsigned user_buffer_mask,
+                        const struct glthread_attrib_binding *buffers)
 {
    int first_size = sizeof(GLint) * draw_count;
    int count_size = sizeof(GLsizei) * draw_count;
-   int attribs_size = util_bitcount(non_vbo_attrib_mask) * sizeof(attribs[0]);
+   int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
    int cmd_size = sizeof(struct marshal_cmd_MultiDrawArrays) +
-                  first_size + count_size + attribs_size;
+                  first_size + count_size + buffers_size;
    struct marshal_cmd_MultiDrawArrays *cmd;
 
    cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArrays,
                                          cmd_size);
    cmd->mode = mode;
    cmd->draw_count = draw_count;
-   cmd->non_vbo_attrib_mask = non_vbo_attrib_mask;
+   cmd->user_buffer_mask = user_buffer_mask;
 
    char *variable_data = (char*)(cmd + 1);
    memcpy(variable_data, first, first_size);
    variable_data += first_size;
    memcpy(variable_data, count, count_size);
 
-   if (non_vbo_attrib_mask) {
+   if (user_buffer_mask) {
       variable_data += count_size;
-      memcpy(variable_data, attribs, attribs_size);
+      memcpy(variable_data, buffers, buffers_size);
    }
 }
 
@@ -347,13 +347,13 @@ _mesa_marshal_MultiDrawArrays(GLenum mode, const GLint *first,
    GET_CURRENT_CONTEXT(ctx);
 
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
-   unsigned non_vbo_attrib_mask = vao->UserPointerMask & vao->Enabled;
+   unsigned user_buffer_mask = vao->UserPointerMask & vao->Enabled;
 
    if (ctx->GLThread.inside_dlist)
       goto sync;
 
    if (draw_count >= 0 &&
-       (ctx->API == API_OPENGL_CORE || !non_vbo_attrib_mask)) {
+       (ctx->API == API_OPENGL_CORE || !user_buffer_mask)) {
       multi_draw_arrays_async(ctx, mode, first, count, draw_count, 0, NULL);
       return;
    }
@@ -389,13 +389,13 @@ _mesa_marshal_MultiDrawArrays(GLenum mode, const GLint *first,
    }
 
    /* Upload and draw. */
-   struct glthread_attrib_binding attribs[VERT_ATTRIB_MAX];
-   if (!upload_vertices(ctx, non_vbo_attrib_mask, min_index, num_vertices,
-                        0, 1, attribs))
+   struct glthread_attrib_binding buffers[VERT_ATTRIB_MAX];
+   if (!upload_vertices(ctx, user_buffer_mask, min_index, num_vertices,
+                        0, 1, buffers))
       goto sync;
 
    multi_draw_arrays_async(ctx, mode, first, count, draw_count,
-                           non_vbo_attrib_mask, attribs);
+                           user_buffer_mask, buffers);
    return;
 
 sync:
@@ -416,7 +416,7 @@ struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance
    GLuint baseinstance;
    GLuint min_index;
    GLuint max_index;
-   GLuint non_vbo_attrib_mask;
+   GLuint user_buffer_mask;
    const GLvoid *indices;
    struct gl_buffer_object *index_buffer;
 };
@@ -434,14 +434,14 @@ _mesa_unmarshal_DrawElementsInstancedBaseVertexBaseInstance(struct gl_context *c
    const GLuint baseinstance = cmd->baseinstance;
    const GLuint min_index = cmd->min_index;
    const GLuint max_index = cmd->max_index;
-   const GLuint non_vbo_attrib_mask = cmd->non_vbo_attrib_mask;
+   const GLuint user_buffer_mask = cmd->user_buffer_mask;
    struct gl_buffer_object *index_buffer = cmd->index_buffer;
-   const struct glthread_attrib_binding *attribs =
+   const struct glthread_attrib_binding *buffers =
       (const struct glthread_attrib_binding *)(cmd + 1);
 
    /* Bind uploaded buffers if needed. */
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       false);
    }
    if (index_buffer) {
@@ -464,8 +464,8 @@ _mesa_unmarshal_DrawElementsInstancedBaseVertexBaseInstance(struct gl_context *c
    if (index_buffer) {
       _mesa_InternalBindElementBuffer(ctx, NULL);
    }
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       true);
    }
 }
@@ -476,12 +476,12 @@ draw_elements_async(struct gl_context *ctx, GLenum mode, GLsizei count,
                     GLint basevertex, GLuint baseinstance,
                     bool index_bounds_valid, GLuint min_index, GLuint max_index,
                     struct gl_buffer_object *index_buffer,
-                    unsigned non_vbo_attrib_mask,
-                    const struct glthread_attrib_binding *attribs)
+                    unsigned user_buffer_mask,
+                    const struct glthread_attrib_binding *buffers)
 {
-   int attribs_size = util_bitcount(non_vbo_attrib_mask) * sizeof(attribs[0]);
+   int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
    int cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance) +
-                  attribs_size;
+                  buffers_size;
    struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd;
 
    cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseVertexBaseInstance, cmd_size);
@@ -494,12 +494,12 @@ draw_elements_async(struct gl_context *ctx, GLenum mode, GLsizei count,
    cmd->baseinstance = baseinstance;
    cmd->min_index = min_index;
    cmd->max_index = max_index;
-   cmd->non_vbo_attrib_mask = non_vbo_attrib_mask;
+   cmd->user_buffer_mask = user_buffer_mask;
    cmd->index_bounds_valid = index_bounds_valid;
    cmd->index_buffer = index_buffer;
 
-   if (non_vbo_attrib_mask)
-      memcpy(cmd + 1, attribs, attribs_size);
+   if (user_buffer_mask)
+      memcpy(cmd + 1, buffers, buffers_size);
 }
 
 static void
@@ -511,7 +511,7 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
    GET_CURRENT_CONTEXT(ctx);
 
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
-   unsigned non_vbo_attrib_mask = vao->UserPointerMask & vao->Enabled;
+   unsigned user_buffer_mask = vao->UserPointerMask & vao->Enabled;
    bool has_user_indices = vao->CurrentElementBufferName == 0;
 
    if (compiled_into_dlist && ctx->GLThread.inside_dlist)
@@ -525,7 +525,7 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
    if (ctx->API == API_OPENGL_CORE ||
        count <= 0 || instance_count <= 0 || max_index < min_index ||
        !is_index_type_valid(type) ||
-       (!non_vbo_attrib_mask && !has_user_indices)) {
+       (!user_buffer_mask && !has_user_indices)) {
       draw_elements_async(ctx, mode, count, type, indices, instance_count,
                           basevertex, baseinstance, index_bounds_valid,
                           min_index, max_index, 0, 0, NULL);
@@ -535,7 +535,7 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
    if (!ctx->GLThread.SupportsNonVBOUploads)
       goto sync;
 
-   bool need_index_bounds = non_vbo_attrib_mask & ~vao->NonZeroDivisorMask;
+   bool need_index_bounds = user_buffer_mask & ~vao->NonZeroDivisorMask;
    unsigned index_size = get_index_size(type);
 
    if (need_index_bounds && !index_bounds_valid) {
@@ -566,10 +566,10 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
    if (util_is_vbo_upload_ratio_too_large(count, num_vertices))
       goto sync;
 
-   struct glthread_attrib_binding attribs[VERT_ATTRIB_MAX];
-   if (non_vbo_attrib_mask &&
-       !upload_vertices(ctx, non_vbo_attrib_mask, start_vertex, num_vertices,
-                        baseinstance, instance_count, attribs))
+   struct glthread_attrib_binding buffers[VERT_ATTRIB_MAX];
+   if (user_buffer_mask &&
+       !upload_vertices(ctx, user_buffer_mask, start_vertex, num_vertices,
+                        baseinstance, instance_count, buffers))
       goto sync;
 
    /* Upload indices. */
@@ -581,7 +581,7 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
    draw_elements_async(ctx, mode, count, type, indices, instance_count,
                        basevertex, baseinstance, index_bounds_valid,
                        min_index, max_index, index_buffer,
-                       non_vbo_attrib_mask, attribs);
+                       user_buffer_mask, buffers);
    return;
 
 sync:
@@ -617,7 +617,7 @@ struct marshal_cmd_MultiDrawElementsBaseVertex
    GLenum mode;
    GLenum type;
    GLsizei draw_count;
-   GLuint non_vbo_attrib_mask;
+   GLuint user_buffer_mask;
    struct gl_buffer_object *index_buffer;
 };
 
@@ -628,7 +628,7 @@ _mesa_unmarshal_MultiDrawElementsBaseVertex(struct gl_context *ctx,
    const GLenum mode = cmd->mode;
    const GLenum type = cmd->type;
    const GLsizei draw_count = cmd->draw_count;
-   const GLuint non_vbo_attrib_mask = cmd->non_vbo_attrib_mask;
+   const GLuint user_buffer_mask = cmd->user_buffer_mask;
    struct gl_buffer_object *index_buffer = cmd->index_buffer;
    const bool has_base_vertex = cmd->has_base_vertex;
 
@@ -642,12 +642,12 @@ _mesa_unmarshal_MultiDrawElementsBaseVertex(struct gl_context *ctx,
       basevertex = (GLsizei *)variable_data;
       variable_data += sizeof(GLsizei) * draw_count;
    }
-   const struct glthread_attrib_binding *attribs =
+   const struct glthread_attrib_binding *buffers =
       (const struct glthread_attrib_binding *)variable_data;
 
    /* Bind uploaded buffers if needed. */
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       false);
    }
    if (index_buffer) {
@@ -668,8 +668,8 @@ _mesa_unmarshal_MultiDrawElementsBaseVertex(struct gl_context *ctx,
    if (index_buffer) {
       _mesa_InternalBindElementBuffer(ctx, NULL);
    }
-   if (non_vbo_attrib_mask) {
-      _mesa_InternalBindVertexBuffers(ctx, attribs, non_vbo_attrib_mask,
+   if (user_buffer_mask) {
+      _mesa_InternalBindVertexBuffers(ctx, buffers, user_buffer_mask,
                                       true);
    }
 }
@@ -680,22 +680,22 @@ multi_draw_elements_async(struct gl_context *ctx, GLenum mode,
                           const GLvoid *const *indices, GLsizei draw_count,
                           const GLsizei *basevertex,
                           struct gl_buffer_object *index_buffer,
-                          unsigned non_vbo_attrib_mask,
-                          const struct glthread_attrib_binding *attribs)
+                          unsigned user_buffer_mask,
+                          const struct glthread_attrib_binding *buffers)
 {
    int count_size = sizeof(GLsizei) * draw_count;
    int indices_size = sizeof(indices[0]) * draw_count;
    int basevertex_size = basevertex ? sizeof(GLsizei) * draw_count : 0;
-   int attribs_size = util_bitcount(non_vbo_attrib_mask) * sizeof(attribs[0]);
+   int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
    int cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsBaseVertex) +
-                  count_size + indices_size + basevertex_size + attribs_size;
+                  count_size + indices_size + basevertex_size + buffers_size;
    struct marshal_cmd_MultiDrawElementsBaseVertex *cmd;
 
    cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsBaseVertex, cmd_size);
    cmd->mode = mode;
    cmd->type = type;
    cmd->draw_count = draw_count;
-   cmd->non_vbo_attrib_mask = non_vbo_attrib_mask;
+   cmd->user_buffer_mask = user_buffer_mask;
    cmd->index_buffer = index_buffer;
    cmd->has_base_vertex = basevertex != NULL;
 
@@ -710,8 +710,8 @@ multi_draw_elements_async(struct gl_context *ctx, GLenum mode,
       variable_data += basevertex_size;
    }
 
-   if (non_vbo_attrib_mask)
-      memcpy(variable_data, attribs, attribs_size);
+   if (user_buffer_mask)
+      memcpy(variable_data, buffers, buffers_size);
 }
 
 void GLAPIENTRY
@@ -724,7 +724,7 @@ _mesa_marshal_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count,
    GET_CURRENT_CONTEXT(ctx);
 
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
-   unsigned non_vbo_attrib_mask = vao->UserPointerMask & vao->Enabled;
+   unsigned user_buffer_mask = vao->UserPointerMask & vao->Enabled;
    bool has_user_indices = vao->CurrentElementBufferName == 0;
 
    if (ctx->GLThread.inside_dlist)
@@ -734,13 +734,13 @@ _mesa_marshal_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count,
    if (draw_count >= 0 &&
        (ctx->API == API_OPENGL_CORE ||
         !is_index_type_valid(type) ||
-        (!non_vbo_attrib_mask && !has_user_indices))) {
+        (!user_buffer_mask && !has_user_indices))) {
       multi_draw_elements_async(ctx, mode, count, type, indices, draw_count,
                                 basevertex, 0, 0, NULL);
       return;
    }
 
-   bool need_index_bounds = non_vbo_attrib_mask & ~vao->NonZeroDivisorMask;
+   bool need_index_bounds = user_buffer_mask & ~vao->NonZeroDivisorMask;
 
    /* If the draw count is too high or negative, the queue can't be used.
     *
@@ -829,10 +829,10 @@ _mesa_marshal_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count,
    }
 
    /* Upload vertices. */
-   struct glthread_attrib_binding attribs[VERT_ATTRIB_MAX];
-   if (non_vbo_attrib_mask &&
-       !upload_vertices(ctx, non_vbo_attrib_mask, min_index, num_vertices,
-                        0, 1, attribs))
+   struct glthread_attrib_binding buffers[VERT_ATTRIB_MAX];
+   if (user_buffer_mask &&
+       !upload_vertices(ctx, user_buffer_mask, min_index, num_vertices,
+                        0, 1, buffers))
       goto sync;
 
    /* Upload indices. */
@@ -848,8 +848,8 @@ _mesa_marshal_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count,
 
    /* Draw asynchronously. */
    multi_draw_elements_async(ctx, mode, count, type, indices, draw_count,
-                             basevertex, index_buffer, non_vbo_attrib_mask,
-                             attribs);
+                             basevertex, index_buffer, user_buffer_mask,
+                             buffers);
    return;
 
 sync:
index 81068d00d0b91545bc03d655c1ce269a852813cd..c50fd8da646cc527c910756063e6a5f616261f77 100644 (file)
@@ -3261,31 +3261,31 @@ _mesa_BindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
 
 void
 _mesa_InternalBindVertexBuffers(struct gl_context *ctx,
-                                const struct glthread_attrib_binding *attribs,
-                                GLbitfield attrib_mask,
+                                const struct glthread_attrib_binding *buffers,
+                                GLbitfield buffer_mask,
                                 GLboolean restore_pointers)
 {
    struct gl_vertex_array_object *vao = ctx->Array.VAO;
    unsigned param_index = 0;
 
    if (restore_pointers) {
-      while (attrib_mask) {
-         unsigned i = u_bit_scan(&attrib_mask);
+      while (buffer_mask) {
+         unsigned i = u_bit_scan(&buffer_mask);
 
          _mesa_bind_vertex_buffer(ctx, vao, i, NULL,
-                                  (GLintptr)attribs[param_index].original_pointer,
+                                  (GLintptr)buffers[param_index].original_pointer,
                                   vao->BufferBinding[i].Stride, false, false);
          param_index++;
       }
       return;
    }
 
-   while (attrib_mask) {
-      unsigned i = u_bit_scan(&attrib_mask);
-      struct gl_buffer_object *buf = attribs[param_index].buffer;
+   while (buffer_mask) {
+      unsigned i = u_bit_scan(&buffer_mask);
+      struct gl_buffer_object *buf = buffers[param_index].buffer;
 
       /* The buffer reference is passed to _mesa_bind_vertex_buffer. */
-      _mesa_bind_vertex_buffer(ctx, vao, i, buf, attribs[param_index].offset,
+      _mesa_bind_vertex_buffer(ctx, vao, i, buf, buffers[param_index].offset,
                                vao->BufferBinding[i].Stride, true, true);
       param_index++;
    }
index 48c257993eb74799a59ea66b708fb5cf2d643445..4508f9cd6b32c44a371bc40da92a337413cad6d0 100644 (file)
@@ -379,8 +379,8 @@ _mesa_BindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
 
 void
 _mesa_InternalBindVertexBuffers(struct gl_context *ctx,
-                                const struct glthread_attrib_binding *attribs,
-                                GLbitfield attrib_mask,
+                                const struct glthread_attrib_binding *buffers,
+                                GLbitfield buffer_mask,
                                 GLboolean restore_pointers);
 
 void GLAPIENTRY