summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-01-15 14:37:04 -0700
committerBrian Paul <[email protected]>2018-01-17 11:17:56 -0700
commit95dec9097fb0a5cf5438f04511a52724ea545302 (patch)
tree1081b7fd567e8aa8ea9916ed7d6518096d547fbd /src/mesa/vbo/vbo_context.c
parent5d78440d5830e5f38ac4b3094aadcd436db18365 (diff)
vbo: change vbo_context attribute map arrays to GLubyte
The values will never be larger than VBO_ATTRIB_MAX (currently 44). v2: add STATIC_ASSERT to be sure VBO_ATTRIB_MAX can fit in ubyte, per Emil. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_context.c')
-rw-r--r--src/mesa/vbo/vbo_context.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index a5f915d9bdb..2d4a973ebd6 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -200,6 +200,9 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx )
{
GLuint i;
+ /* make sure all VBO_ATTRIB_ values can fit in an unsigned byte */
+ STATIC_ASSERT(VBO_ATTRIB_MAX <= 255);
+
/* identity mapping */
for (i = 0; i < ARRAY_SIZE(vbo->map_vp_none); i++)
vbo->map_vp_none[i] = i;