summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.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
commit1217a8448c1061d230956ac6e69a1bb3809dd6f2 (patch)
treea0977d47c0f0ae6ff580b4d5e0ab3fbc5bd49f58 /src/mesa/main/varray.c
parent73d2d313e9fafc8e8a6ac54af1da18d476821e7a (diff)
mesa: Use the gl_vertex_array_object::Enabled bitfield.
Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. 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/varray.c')
-rw-r--r--src/mesa/main/varray.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index e1675ff5135..e8969eb954a 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1267,7 +1267,7 @@ get_vertex_array_attrib(struct gl_context *ctx,
switch (pname) {
case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
- return array->Enabled;
+ return !!(vao->Enabled & VERT_BIT_GENERIC(index));
case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB:
return (array->Format == GL_BGRA) ? GL_BGRA : array->Size;
case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB:
@@ -2812,11 +2812,10 @@ _mesa_print_arrays(struct gl_context *ctx)
fprintf(stderr, "Array Object %u\n", vao->Name);
- gl_vert_attrib i;
- for (i = 0; i < VERT_ATTRIB_MAX; ++i) {
+ GLbitfield mask = vao->Enabled;
+ while (mask) {
+ const gl_vert_attrib i = u_bit_scan(&mask);
const struct gl_array_attributes *array = &vao->VertexAttrib[i];
- if (!array->Enabled)
- continue;
const struct gl_vertex_buffer_binding *binding =
&vao->BufferBinding[array->BufferBindingIndex];