diff options
author | Marek Olšák <[email protected]> | 2017-11-15 22:58:58 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-11-25 17:17:52 +0100 |
commit | 2116b974189b4d58d02bc1c9810aef820eed71b6 (patch) | |
tree | a450b3bcab8209013d13ae8ee3d5ce47b6c470fc /src/mesa/tnl/t_context.h | |
parent | bd57f45168188caabce3aebed287a9d32bc00537 (diff) |
mesa: don't assign numbers to vertex attrib enums manually
I plan to remove one of them.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/tnl/t_context.h')
-rw-r--r-- | src/mesa/tnl/t_context.h | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index e7adb5f533e..67a87f26af5 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -76,39 +76,46 @@ * attribs want (16). */ enum { - _TNL_ATTRIB_POS = 0, - _TNL_ATTRIB_WEIGHT = 1, - _TNL_ATTRIB_NORMAL = 2, - _TNL_ATTRIB_COLOR0 = 3, - _TNL_ATTRIB_COLOR1 = 4, - _TNL_ATTRIB_FOG = 5, - _TNL_ATTRIB_COLOR_INDEX = 6, - _TNL_ATTRIB_EDGEFLAG = 7, - _TNL_ATTRIB_TEX0 = 8, - _TNL_ATTRIB_TEX1 = 9, - _TNL_ATTRIB_TEX2 = 10, - _TNL_ATTRIB_TEX3 = 11, - _TNL_ATTRIB_TEX4 = 12, - _TNL_ATTRIB_TEX5 = 13, - _TNL_ATTRIB_TEX6 = 14, - _TNL_ATTRIB_TEX7 = 15, - - _TNL_ATTRIB_GENERIC0 = 17, /* doesn't really exist! */ - _TNL_ATTRIB_GENERIC1 = 18, - _TNL_ATTRIB_GENERIC2 = 19, - _TNL_ATTRIB_GENERIC3 = 20, - _TNL_ATTRIB_GENERIC4 = 21, - _TNL_ATTRIB_GENERIC5 = 22, - _TNL_ATTRIB_GENERIC6 = 23, - _TNL_ATTRIB_GENERIC7 = 24, - _TNL_ATTRIB_GENERIC8 = 25, - _TNL_ATTRIB_GENERIC9 = 26, - _TNL_ATTRIB_GENERIC10 = 27, - _TNL_ATTRIB_GENERIC11 = 28, - _TNL_ATTRIB_GENERIC12 = 29, - _TNL_ATTRIB_GENERIC13 = 30, - _TNL_ATTRIB_GENERIC14 = 31, - _TNL_ATTRIB_GENERIC15 = 32, + _TNL_ATTRIB_POS, + _TNL_ATTRIB_WEIGHT, + _TNL_ATTRIB_NORMAL, + _TNL_ATTRIB_COLOR0, + _TNL_ATTRIB_COLOR1, + _TNL_ATTRIB_FOG, + _TNL_ATTRIB_COLOR_INDEX, + _TNL_ATTRIB_EDGEFLAG, + _TNL_ATTRIB_TEX0, + _TNL_ATTRIB_TEX1, + _TNL_ATTRIB_TEX2, + _TNL_ATTRIB_TEX3, + _TNL_ATTRIB_TEX4, + _TNL_ATTRIB_TEX5, + _TNL_ATTRIB_TEX6, + _TNL_ATTRIB_TEX7, + + /* This is really a VARYING_SLOT, not an attrib. Need to fix + * tnl to understand the difference. + */ + _TNL_ATTRIB_POINTSIZE, + + _TNL_ATTRIB_GENERIC0, /* doesn't really exist! */ + _TNL_ATTRIB_GENERIC1, + _TNL_ATTRIB_GENERIC2, + _TNL_ATTRIB_GENERIC3, + _TNL_ATTRIB_GENERIC4, + _TNL_ATTRIB_GENERIC5, + _TNL_ATTRIB_GENERIC6, + _TNL_ATTRIB_GENERIC7, + _TNL_ATTRIB_GENERIC8, + _TNL_ATTRIB_GENERIC9, + _TNL_ATTRIB_GENERIC10, + _TNL_ATTRIB_GENERIC11, + _TNL_ATTRIB_GENERIC12, + _TNL_ATTRIB_GENERIC13, + _TNL_ATTRIB_GENERIC14, + _TNL_ATTRIB_GENERIC15, + + _TNL_ATTRIB_MAX, /* These alias with the generics, but they are not active * concurrently, so it's not a problem. The TNL module @@ -120,26 +127,19 @@ enum { * generic attribute in order to pick up per-vertex material * data. */ - _TNL_ATTRIB_MAT_FRONT_AMBIENT = 17, - _TNL_ATTRIB_MAT_BACK_AMBIENT = 18, - _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 19, - _TNL_ATTRIB_MAT_BACK_DIFFUSE = 20, - _TNL_ATTRIB_MAT_FRONT_SPECULAR = 21, - _TNL_ATTRIB_MAT_BACK_SPECULAR = 22, - _TNL_ATTRIB_MAT_FRONT_EMISSION = 23, - _TNL_ATTRIB_MAT_BACK_EMISSION = 24, - _TNL_ATTRIB_MAT_FRONT_SHININESS = 25, - _TNL_ATTRIB_MAT_BACK_SHININESS = 26, - _TNL_ATTRIB_MAT_FRONT_INDEXES = 27, - _TNL_ATTRIB_MAT_BACK_INDEXES = 28, - - /* This is really a VARYING_SLOT, not an attrib. Need to fix - * tnl to understand the difference. - */ - _TNL_ATTRIB_POINTSIZE = 16, - - _TNL_ATTRIB_MAX = 33 -} ; + _TNL_ATTRIB_MAT_FRONT_AMBIENT = _TNL_ATTRIB_GENERIC0, + _TNL_ATTRIB_MAT_BACK_AMBIENT, + _TNL_ATTRIB_MAT_FRONT_DIFFUSE, + _TNL_ATTRIB_MAT_BACK_DIFFUSE, + _TNL_ATTRIB_MAT_FRONT_SPECULAR, + _TNL_ATTRIB_MAT_BACK_SPECULAR, + _TNL_ATTRIB_MAT_FRONT_EMISSION, + _TNL_ATTRIB_MAT_BACK_EMISSION, + _TNL_ATTRIB_MAT_FRONT_SHININESS, + _TNL_ATTRIB_MAT_BACK_SHININESS, + _TNL_ATTRIB_MAT_FRONT_INDEXES, + _TNL_ATTRIB_MAT_BACK_INDEXES, +}; #define _TNL_ATTRIB_TEX(u) (_TNL_ATTRIB_TEX0 + (u)) #define _TNL_ATTRIB_GENERIC(n) (_TNL_ATTRIB_GENERIC0 + (n)) |