summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-11-17 07:13:11 +0100
committerMathias Fröhlich <[email protected]>2018-11-21 06:27:19 +0100
commit0a7020b4e60ef69e0e4b38aee31bfce385e594d8 (patch)
tree64e68add5e2e22579c6ef715707c1dd99c1ecde1 /src/mesa/main/get.c
parent2da7b0a2fbf0dbc5e89f19622cf3bbfa346ed0f1 (diff)
mesa: Factor out struct gl_vertex_format.
Factor out struct gl_vertex_format from array attributes. The data type is supposed to describe the type of a vertex element. At this current stage the data type is only used with the VAO, but actually is useful in various other places. Due to the bitfields being used, special care needs to be taken for the glGet code paths. v2: Change unsigned char -> GLubyte. Use struct assignment for struct gl_vertex_format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index ac17539f094..ee77c45d03c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -755,13 +755,22 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_bool = !!(ctx->Array.VAO->Enabled & VERT_BIT_POINT_SIZE);
break;
- case GL_TEXTURE_COORD_ARRAY_SIZE:
case GL_TEXTURE_COORD_ARRAY_TYPE:
case GL_TEXTURE_COORD_ARRAY_STRIDE:
array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)];
v->value_int = *(GLuint *) ((char *) array + d->offset);
break;
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)];
+ v->value_int = array->Format.Size;
+ break;
+
+ case GL_VERTEX_ARRAY_SIZE:
+ array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS];
+ v->value_int = array->Format.Size;
+ break;
+
case GL_ACTIVE_TEXTURE_ARB:
v->value_int = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
break;
@@ -969,11 +978,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
/* ARB_vertex_array_bgra */
case GL_COLOR_ARRAY_SIZE:
array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR0];
- v->value_int = array->Format == GL_BGRA ? GL_BGRA : array->Size;
+ v->value_int = array->Format.Format == GL_BGRA ? GL_BGRA : array->Format.Size;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE:
array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR1];
- v->value_int = array->Format == GL_BGRA ? GL_BGRA : array->Size;
+ v->value_int = array->Format.Format == GL_BGRA ? GL_BGRA : array->Format.Size;
break;
/* ARB_copy_buffer */