diff options
author | Mathias Fröhlich <[email protected]> | 2018-01-27 16:07:22 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-02-01 22:39:07 +0100 |
commit | 3d4fb879ddbce1c5da7199ae74bc2e7ae98d1b70 (patch) | |
tree | 886e65a3a68bfd422e067e92caff2b4351d20134 /src/mesa/vbo/vbo_context.c | |
parent | b4fd63015ac7fd73e0147ff078caec47be729e87 (diff) |
vbo: Use static const VERT_ATTRIB->VBO_ATTRIB maps.
Instead of each context having its own map instance for
this purpose, use a global static const map.
v2: s,unsigned char,GLubyte,g
s,_VP_MODE_MAX,VP_MODE_MAX,g
Change comment style.
Signed-off-by: Mathias Fröhlich <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_context.c')
-rw-r--r-- | src/mesa/vbo/vbo_context.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 4fa6f62ad09..5bc6bf0acd7 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -236,27 +236,8 @@ _vbo_CreateContext(struct gl_context *ctx) init_mat_currval(ctx); vbo_set_indirect_draw_func(ctx, vbo_draw_indirect_prims); - /* Build mappings from VERT_ATTRIB -> VBO_ATTRIB depending on type - * of vertex program active. - */ - { - 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; - /* map material attribs to generic slots */ - for (i = 0; i < VERT_ATTRIB_MAT_MAX; i++) - vbo->map_vp_none[VERT_ATTRIB_MAT(i)] - = VBO_ATTRIB_MAT_FRONT_AMBIENT + i; - - for (i = 0; i < ARRAY_SIZE(vbo->map_vp_arb); i++) - vbo->map_vp_arb[i] = i; - } - + /* make sure all VBO_ATTRIB_ values can fit in an unsigned byte */ + STATIC_ASSERT(VBO_ATTRIB_MAX <= 255); /* Hook our functions into exec and compile dispatch tables. These * will pretty much be permanently installed, which means that the |