[Mesa-dev] [PATCH 02/23] mesa: Make bind_vertex_buffer avilable outside varray.c

Anuj Phogat anuj.phogat at gmail.com
Tue Nov 10 09:52:20 PST 2015


On Mon, Nov 9, 2015 at 4:56 PM, Ian Romanick <idr at freedesktop.org> wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/main/varray.c | 29 +++++++++++++++--------------
>  src/mesa/main/varray.h |  7 +++++++
>  2 files changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index 887d0c0..5e0534a 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -154,12 +154,12 @@ vertex_attrib_binding(struct gl_context *ctx,
>   * Binds a buffer object to the vertex buffer binding point given by index,
>   * and sets the Offset and Stride fields.
>   */
> -static void
> -bind_vertex_buffer(struct gl_context *ctx,
> -                   struct gl_vertex_array_object *vao,
> -                   GLuint index,
> -                   struct gl_buffer_object *vbo,
> -                   GLintptr offset, GLsizei stride)
> +void
> +_mesa_bind_vertex_buffer(struct gl_context *ctx,
> +                         struct gl_vertex_array_object *vao,
> +                         GLuint index,
> +                         struct gl_buffer_object *vbo,
> +                         GLintptr offset, GLsizei stride)
>  {
>     struct gl_vertex_buffer_binding *binding = &vao->VertexBinding[index];
>
> @@ -491,8 +491,9 @@ update_array(struct gl_context *ctx,
>
>     /* Update the vertex buffer binding */
>     effectiveStride = stride != 0 ? stride : array->_ElementSize;
> -   bind_vertex_buffer(ctx, ctx->Array.VAO, attrib, ctx->Array.ArrayBufferObj,
> -                      (GLintptr) ptr, effectiveStride);
> +   _mesa_bind_vertex_buffer(ctx, ctx->Array.VAO, attrib,
> +                            ctx->Array.ArrayBufferObj, (GLintptr) ptr,
> +                            effectiveStride);
>  }
>
>
> @@ -1716,8 +1717,8 @@ vertex_array_vertex_buffer(struct gl_context *ctx,
>        vbo = ctx->Shared->NullBufferObj;
>     }
>
> -   bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(bindingIndex),
> -                      vbo, offset, stride);
> +   _mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(bindingIndex),
> +                            vbo, offset, stride);
>  }
>
>
> @@ -1804,8 +1805,8 @@ vertex_array_vertex_buffers(struct gl_context *ctx,
>        struct gl_buffer_object *vbo = ctx->Shared->NullBufferObj;
>
>        for (i = 0; i < count; i++)
> -         bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
> -                            vbo, 0, 16);
> +         _mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
> +                                  vbo, 0, 16);
>
>        return;
>     }
> @@ -1876,8 +1877,8 @@ vertex_array_vertex_buffers(struct gl_context *ctx,
>           vbo = ctx->Shared->NullBufferObj;
>        }
>
> -      bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
> -                         vbo, offsets[i], strides[i]);
> +      _mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
> +                               vbo, offsets[i], strides[i]);
>     }
>
>     _mesa_end_bufferobj_lookups(ctx);
> diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
> index 5583ed5..1579b76 100644
> --- a/src/mesa/main/varray.h
> +++ b/src/mesa/main/varray.h
> @@ -90,6 +90,13 @@ _mesa_attr_zero_aliases_vertex(struct gl_context *ctx)
>                 && !is_forward_compatible_context));
>  }
>
> +extern void
> +_mesa_bind_vertex_buffer(struct gl_context *ctx,
> +                         struct gl_vertex_array_object *vao,
> +                         GLuint index,
> +                         struct gl_buffer_object *vbo,
> +                         GLintptr offset, GLsizei stride);
> +
>  extern void GLAPIENTRY
>  _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
>                      const GLvoid *ptr);
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list