mesa: rename gl_vertex_attrib_array gl_array_attributes

The structure contains the attributes of a vertex array.  The old name
was kind of confusing.

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
This commit is contained in:
Brian Paul
2016-10-06 17:30:20 -06:00
parent c89802aeea
commit 15fb88e912
8 changed files with 31 additions and 31 deletions

View File

@@ -48,7 +48,7 @@
typedef void (GLAPIENTRY *array_func)( const void * ); typedef void (GLAPIENTRY *array_func)( const void * );
typedef struct { typedef struct {
const struct gl_vertex_attrib_array *array; const struct gl_array_attributes *array;
const struct gl_vertex_buffer_binding *binding; const struct gl_vertex_buffer_binding *binding;
int offset; int offset;
} AEarray; } AEarray;
@@ -56,7 +56,7 @@ typedef struct {
typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data );
typedef struct { typedef struct {
const struct gl_vertex_attrib_array *array; const struct gl_array_attributes *array;
const struct gl_vertex_buffer_binding *binding; const struct gl_vertex_buffer_binding *binding;
attrib_func func; attrib_func func;
GLuint index; GLuint index;
@@ -1613,7 +1613,7 @@ _ae_update_state(struct gl_context *ctx)
} }
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
struct gl_vertex_attrib_array *attribArray = struct gl_array_attributes *attribArray =
&vao->VertexAttrib[VERT_ATTRIB_TEX(i)]; &vao->VertexAttrib[VERT_ATTRIB_TEX(i)];
if (attribArray->Enabled) { if (attribArray->Enabled) {
/* NOTE: we use generic glVertexAttribNV functions here. /* NOTE: we use generic glVertexAttribNV functions here.
@@ -1633,7 +1633,7 @@ _ae_update_state(struct gl_context *ctx)
/* generic vertex attribute arrays */ /* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */ for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */
struct gl_vertex_attrib_array *attribArray = struct gl_array_attributes *attribArray =
&vao->VertexAttrib[VERT_ATTRIB_GENERIC(i)]; &vao->VertexAttrib[VERT_ATTRIB_GENERIC(i)];
if (attribArray->Enabled) { if (attribArray->Enabled) {
GLint intOrNorm; GLint intOrNorm;

View File

@@ -235,7 +235,7 @@ init_array(struct gl_context *ctx,
struct gl_vertex_array_object *vao, struct gl_vertex_array_object *vao,
GLuint index, GLint size, GLint type) GLuint index, GLint size, GLint type)
{ {
struct gl_vertex_attrib_array *array = &vao->VertexAttrib[index]; struct gl_array_attributes *array = &vao->VertexAttrib[index];
struct gl_vertex_buffer_binding *binding = &vao->VertexBinding[index]; struct gl_vertex_buffer_binding *binding = &vao->VertexBinding[index];
array->Size = size; array->Size = size;
@@ -353,7 +353,7 @@ _mesa_update_vao_client_arrays(struct gl_context *ctx,
const int attrib = u_bit_scan64(&arrays); const int attrib = u_bit_scan64(&arrays);
struct gl_client_array *client_array; struct gl_client_array *client_array;
struct gl_vertex_attrib_array *attrib_array; struct gl_array_attributes *attrib_array;
struct gl_vertex_buffer_binding *buffer_binding; struct gl_vertex_buffer_binding *buffer_binding;
attrib_array = &vao->VertexAttrib[attrib]; attrib_array = &vao->VertexAttrib[attrib];
@@ -377,7 +377,7 @@ _mesa_all_varyings_in_vbos(const struct gl_vertex_array_object *vao)
* attrib arrays at once * attrib arrays at once
*/ */
const int i = ffsll(mask) - 1; const int i = ffsll(mask) - 1;
const struct gl_vertex_attrib_array *attrib_array = const struct gl_array_attributes *attrib_array =
&vao->VertexAttrib[i]; &vao->VertexAttrib[i];
const struct gl_vertex_buffer_binding *buffer_binding = const struct gl_vertex_buffer_binding *buffer_binding =
&vao->VertexBinding[attrib_array->BufferBindingIndex]; &vao->VertexBinding[attrib_array->BufferBindingIndex];
@@ -408,7 +408,7 @@ _mesa_all_buffers_are_unmapped(const struct gl_vertex_array_object *vao)
while (mask) { while (mask) {
const int i = ffsll(mask) - 1; const int i = ffsll(mask) - 1;
const struct gl_vertex_attrib_array *attrib_array = const struct gl_array_attributes *attrib_array =
&vao->VertexAttrib[i]; &vao->VertexAttrib[i];
const struct gl_vertex_buffer_binding *buffer_binding = const struct gl_vertex_buffer_binding *buffer_binding =
&vao->VertexBinding[attrib_array->BufferBindingIndex]; &vao->VertexBinding[attrib_array->BufferBindingIndex];

View File

@@ -607,7 +607,7 @@ static void
find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v) find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v)
{ {
struct gl_buffer_object **buffer_obj; struct gl_buffer_object **buffer_obj;
struct gl_vertex_attrib_array *array; struct gl_array_attributes *array;
GLuint unit, *p; GLuint unit, *p;
switch (d->pname) { switch (d->pname) {

View File

@@ -217,10 +217,10 @@ descriptor=[
[ "COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ], [ "COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
[ "COLOR_ARRAY_TYPE", "ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA" ], [ "COLOR_ARRAY_TYPE", "ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA" ],
[ "COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA" ], [ "COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY", "LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_vertex_attrib_array, Enabled), NO_EXTRA" ], [ "TEXTURE_COORD_ARRAY", "LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_array_attributes, Enabled), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_vertex_attrib_array, Size), NO_EXTRA" ], [ "TEXTURE_COORD_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_array_attributes, Size), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY_TYPE", "LOC_CUSTOM, TYPE_ENUM, offsetof(struct gl_vertex_attrib_array, Type), NO_EXTRA" ], [ "TEXTURE_COORD_ARRAY_TYPE", "LOC_CUSTOM, TYPE_ENUM, offsetof(struct gl_array_attributes, Type), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY_STRIDE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_vertex_attrib_array, Stride), NO_EXTRA" ], [ "TEXTURE_COORD_ARRAY_STRIDE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_array_attributes, Stride), NO_EXTRA" ],
# GL_ARB_multitexture # GL_ARB_multitexture
[ "MAX_TEXTURE_UNITS", "CONTEXT_INT(Const.MaxTextureUnits), NO_EXTRA" ], [ "MAX_TEXTURE_UNITS", "CONTEXT_INT(Const.MaxTextureUnits), NO_EXTRA" ],

View File

@@ -1351,7 +1351,7 @@ struct gl_client_array
/** /**
* Vertex attribute array as seen by the client. * Attributes to describe a vertex array.
* *
* Contains the size, type, format and normalization flag, * Contains the size, type, format and normalization flag,
* along with the index of a vertex buffer binding point. * along with the index of a vertex buffer binding point.
@@ -1363,7 +1363,7 @@ struct gl_client_array
* and VERTEX_BINDING_STRIDE to the same value, while * and VERTEX_BINDING_STRIDE to the same value, while
* glBindVertexBuffer() will only set VERTEX_BINDING_STRIDE. * glBindVertexBuffer() will only set VERTEX_BINDING_STRIDE.
*/ */
struct gl_vertex_attrib_array struct gl_array_attributes
{ {
GLint Size; /**< Components per element (1,2,3,4) */ GLint Size; /**< Components per element (1,2,3,4) */
GLenum Type; /**< Datatype: GL_FLOAT, GL_INT, etc */ GLenum Type; /**< Datatype: GL_FLOAT, GL_INT, etc */
@@ -1441,7 +1441,7 @@ struct gl_vertex_array_object
struct gl_client_array _VertexAttrib[VERT_ATTRIB_MAX]; struct gl_client_array _VertexAttrib[VERT_ATTRIB_MAX];
/** Vertex attribute arrays */ /** Vertex attribute arrays */
struct gl_vertex_attrib_array VertexAttrib[VERT_ATTRIB_MAX]; struct gl_array_attributes VertexAttrib[VERT_ATTRIB_MAX];
/** Vertex buffer bindings */ /** Vertex buffer bindings */
struct gl_vertex_buffer_binding VertexBinding[VERT_ATTRIB_MAX]; struct gl_vertex_buffer_binding VertexBinding[VERT_ATTRIB_MAX];

View File

@@ -133,7 +133,7 @@ vertex_attrib_binding(struct gl_context *ctx,
GLuint attribIndex, GLuint attribIndex,
GLuint bindingIndex) GLuint bindingIndex)
{ {
struct gl_vertex_attrib_array *array = &vao->VertexAttrib[attribIndex]; struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
if (!_mesa_is_bufferobj(vao->VertexBinding[bindingIndex].BufferObj)) if (!_mesa_is_bufferobj(vao->VertexBinding[bindingIndex].BufferObj))
vao->VertexAttribBufferMask &= ~VERT_BIT(attribIndex); vao->VertexAttribBufferMask &= ~VERT_BIT(attribIndex);
@@ -278,7 +278,7 @@ _mesa_update_array_format(struct gl_context *ctx,
GLboolean integer, GLboolean doubles, GLboolean integer, GLboolean doubles,
GLuint relativeOffset, bool flush_vertices) GLuint relativeOffset, bool flush_vertices)
{ {
struct gl_vertex_attrib_array *const array = &vao->VertexAttrib[attrib]; struct gl_array_attributes *const array = &vao->VertexAttrib[attrib];
GLint elementSize; GLint elementSize;
assert(size <= 4); assert(size <= 4);
@@ -465,7 +465,7 @@ update_array(struct gl_context *ctx,
GLboolean normalized, GLboolean integer, GLboolean doubles, GLboolean normalized, GLboolean integer, GLboolean doubles,
const GLvoid *ptr) const GLvoid *ptr)
{ {
struct gl_vertex_attrib_array *array; struct gl_array_attributes *array;
GLsizei effectiveStride; GLsizei effectiveStride;
/* Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says: /* Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says:
@@ -905,7 +905,7 @@ get_vertex_array_attrib(struct gl_context *ctx,
GLuint index, GLenum pname, GLuint index, GLenum pname,
const char *caller) const char *caller)
{ {
const struct gl_vertex_attrib_array *array; const struct gl_array_attributes *array;
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", caller, index); _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", caller, index);
@@ -2327,8 +2327,8 @@ _mesa_copy_client_array(struct gl_context *ctx,
void void
_mesa_copy_vertex_attrib_array(struct gl_context *ctx, _mesa_copy_vertex_attrib_array(struct gl_context *ctx,
struct gl_vertex_attrib_array *dst, struct gl_array_attributes *dst,
const struct gl_vertex_attrib_array *src) const struct gl_array_attributes *src)
{ {
dst->Size = src->Size; dst->Size = src->Size;
dst->Type = src->Type; dst->Type = src->Type;
@@ -2369,7 +2369,7 @@ _mesa_print_arrays(struct gl_context *ctx)
unsigned i; unsigned i;
for (i = 0; i < VERT_ATTRIB_MAX; ++i) { for (i = 0; i < VERT_ATTRIB_MAX; ++i) {
const struct gl_vertex_attrib_array *array = &vao->VertexAttrib[i]; const struct gl_array_attributes *array = &vao->VertexAttrib[i];
if (!array->Enabled) if (!array->Enabled)
continue; continue;

View File

@@ -40,7 +40,7 @@ struct gl_context;
* a vertex buffer. * a vertex buffer.
*/ */
static inline const GLubyte * static inline const GLubyte *
_mesa_vertex_attrib_address(const struct gl_vertex_attrib_array *array, _mesa_vertex_attrib_address(const struct gl_array_attributes *array,
const struct gl_vertex_buffer_binding *binding) const struct gl_vertex_buffer_binding *binding)
{ {
if (_mesa_is_bufferobj(binding->BufferObj)) if (_mesa_is_bufferobj(binding->BufferObj))
@@ -56,7 +56,7 @@ _mesa_vertex_attrib_address(const struct gl_vertex_attrib_array *array,
static inline void static inline void
_mesa_update_client_array(struct gl_context *ctx, _mesa_update_client_array(struct gl_context *ctx,
struct gl_client_array *dst, struct gl_client_array *dst,
const struct gl_vertex_attrib_array *src, const struct gl_array_attributes *src,
const struct gl_vertex_buffer_binding *binding) const struct gl_vertex_buffer_binding *binding)
{ {
dst->Size = src->Size; dst->Size = src->Size;
@@ -378,8 +378,8 @@ _mesa_copy_client_array(struct gl_context *ctx,
extern void extern void
_mesa_copy_vertex_attrib_array(struct gl_context *ctx, _mesa_copy_vertex_attrib_array(struct gl_context *ctx,
struct gl_vertex_attrib_array *dst, struct gl_array_attributes *dst,
const struct gl_vertex_attrib_array *src); const struct gl_array_attributes *src);
extern void extern void
_mesa_copy_vertex_buffer_binding(struct gl_context *ctx, _mesa_copy_vertex_buffer_binding(struct gl_context *ctx,

View File

@@ -51,7 +51,7 @@ static void
check_array_data(struct gl_context *ctx, struct gl_vertex_array_object *vao, check_array_data(struct gl_context *ctx, struct gl_vertex_array_object *vao,
GLuint attrib, GLuint j) GLuint attrib, GLuint j)
{ {
const struct gl_vertex_attrib_array *array = &vao->VertexAttrib[attrib]; const struct gl_array_attributes *array = &vao->VertexAttrib[attrib];
if (array->Enabled) { if (array->Enabled) {
const struct gl_vertex_buffer_binding *binding = const struct gl_vertex_buffer_binding *binding =
&vao->VertexBinding[array->BufferBindingIndex]; &vao->VertexBinding[array->BufferBindingIndex];
@@ -103,7 +103,7 @@ static void
unmap_array_buffer(struct gl_context *ctx, struct gl_vertex_array_object *vao, unmap_array_buffer(struct gl_context *ctx, struct gl_vertex_array_object *vao,
GLuint attrib) GLuint attrib)
{ {
const struct gl_vertex_attrib_array *array = &vao->VertexAttrib[attrib]; const struct gl_array_attributes *array = &vao->VertexAttrib[attrib];
if (array->Enabled) { if (array->Enabled) {
const struct gl_vertex_buffer_binding *binding = const struct gl_vertex_buffer_binding *binding =
&vao->VertexBinding[array->BufferBindingIndex]; &vao->VertexBinding[array->BufferBindingIndex];
@@ -196,7 +196,7 @@ print_draw_arrays(struct gl_context *ctx,
unsigned i; unsigned i;
for (i = 0; i < VERT_ATTRIB_MAX; ++i) { for (i = 0; i < VERT_ATTRIB_MAX; ++i) {
const struct gl_vertex_attrib_array *array = &vao->VertexAttrib[i]; const struct gl_array_attributes *array = &vao->VertexAttrib[i];
if (!array->Enabled) if (!array->Enabled)
continue; continue;
@@ -245,7 +245,7 @@ recalculate_input_bindings(struct gl_context *ctx)
{ {
struct vbo_context *vbo = vbo_context(ctx); struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec; struct vbo_exec_context *exec = &vbo->exec;
const struct gl_vertex_attrib_array *array = ctx->Array.VAO->VertexAttrib; const struct gl_array_attributes *array = ctx->Array.VAO->VertexAttrib;
struct gl_client_array *vertexAttrib = ctx->Array.VAO->_VertexAttrib; struct gl_client_array *vertexAttrib = ctx->Array.VAO->_VertexAttrib;
const struct gl_client_array **inputs = &exec->array.inputs[0]; const struct gl_client_array **inputs = &exec->array.inputs[0];
GLbitfield64 const_inputs = 0x0; GLbitfield64 const_inputs = 0x0;