[Mesa-dev] [PATCH 2/8] mesa: add an assertion in _mesa_enable_vertex_array_attrib()

Brian Paul brianp at vmware.com
Mon Jan 29 20:42:48 UTC 2018


Some of the enable/disable vertex array functions take a zero-based
generic index, while others take a VERT_ATTRIB_GENERIC0-based value.
Add an assertion to clarify that in one place.
---
 src/mesa/main/varray.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 31f1c83..bda1c5a 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1064,6 +1064,7 @@ _mesa_enable_vertex_array_attrib(struct gl_context *ctx,
                                  struct gl_vertex_array_object *vao,
                                  unsigned attrib)
 {
+   assert(attrib >= VERT_ATTRIB_GENERIC0);
    assert(attrib < ARRAY_SIZE(vao->VertexAttrib));
 
    if (!vao->VertexAttrib[attrib].Enabled) {
-- 
2.7.4



More information about the mesa-dev mailing list