summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-15 22:58:58 +0100
committerMarek Olšák <[email protected]>2017-11-25 17:17:52 +0100
commit2116b974189b4d58d02bc1c9810aef820eed71b6 (patch)
treea450b3bcab8209013d13ae8ee3d5ce47b6c470fc /src/mesa
parentbd57f45168188caabce3aebed287a9d32bc00537 (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')
-rw-r--r--src/mesa/tnl/t_context.h106
-rw-r--r--src/mesa/vbo/vbo_attrib.h92
2 files changed, 99 insertions, 99 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))
diff --git a/src/mesa/vbo/vbo_attrib.h b/src/mesa/vbo/vbo_attrib.h
index 5ee77fe1920..560c82623ba 100644
--- a/src/mesa/vbo/vbo_attrib.h
+++ b/src/mesa/vbo/vbo_attrib.h
@@ -44,60 +44,60 @@
* program instruction formats and register layouts.
*/
enum {
- VBO_ATTRIB_POS = 0,
- VBO_ATTRIB_WEIGHT = 1,
- VBO_ATTRIB_NORMAL = 2,
- VBO_ATTRIB_COLOR0 = 3,
- VBO_ATTRIB_COLOR1 = 4,
- VBO_ATTRIB_FOG = 5,
- VBO_ATTRIB_INDEX = 6,
- VBO_ATTRIB_EDGEFLAG = 7,
- VBO_ATTRIB_TEX0 = 8,
- VBO_ATTRIB_TEX1 = 9,
- VBO_ATTRIB_TEX2 = 10,
- VBO_ATTRIB_TEX3 = 11,
- VBO_ATTRIB_TEX4 = 12,
- VBO_ATTRIB_TEX5 = 13,
- VBO_ATTRIB_TEX6 = 14,
- VBO_ATTRIB_TEX7 = 15,
- VBO_ATTRIB_POINT_SIZE = 16,
+ VBO_ATTRIB_POS,
+ VBO_ATTRIB_WEIGHT,
+ VBO_ATTRIB_NORMAL,
+ VBO_ATTRIB_COLOR0,
+ VBO_ATTRIB_COLOR1,
+ VBO_ATTRIB_FOG,
+ VBO_ATTRIB_INDEX,
+ VBO_ATTRIB_EDGEFLAG,
+ VBO_ATTRIB_TEX0,
+ VBO_ATTRIB_TEX1,
+ VBO_ATTRIB_TEX2,
+ VBO_ATTRIB_TEX3,
+ VBO_ATTRIB_TEX4,
+ VBO_ATTRIB_TEX5,
+ VBO_ATTRIB_TEX6,
+ VBO_ATTRIB_TEX7,
+ VBO_ATTRIB_POINT_SIZE,
- VBO_ATTRIB_GENERIC0 = 17, /* Not used? */
- VBO_ATTRIB_GENERIC1 = 18,
- VBO_ATTRIB_GENERIC2 = 19,
- VBO_ATTRIB_GENERIC3 = 20,
- VBO_ATTRIB_GENERIC4 = 21,
- VBO_ATTRIB_GENERIC5 = 22,
- VBO_ATTRIB_GENERIC6 = 23,
- VBO_ATTRIB_GENERIC7 = 24,
- VBO_ATTRIB_GENERIC8 = 25,
- VBO_ATTRIB_GENERIC9 = 26,
- VBO_ATTRIB_GENERIC10 = 27,
- VBO_ATTRIB_GENERIC11 = 28,
- VBO_ATTRIB_GENERIC12 = 29,
- VBO_ATTRIB_GENERIC13 = 30,
- VBO_ATTRIB_GENERIC14 = 31,
- VBO_ATTRIB_GENERIC15 = 32,
+ VBO_ATTRIB_GENERIC0, /* Not used? */
+ VBO_ATTRIB_GENERIC1,
+ VBO_ATTRIB_GENERIC2,
+ VBO_ATTRIB_GENERIC3,
+ VBO_ATTRIB_GENERIC4,
+ VBO_ATTRIB_GENERIC5,
+ VBO_ATTRIB_GENERIC6,
+ VBO_ATTRIB_GENERIC7,
+ VBO_ATTRIB_GENERIC8,
+ VBO_ATTRIB_GENERIC9,
+ VBO_ATTRIB_GENERIC10,
+ VBO_ATTRIB_GENERIC11,
+ VBO_ATTRIB_GENERIC12,
+ VBO_ATTRIB_GENERIC13,
+ VBO_ATTRIB_GENERIC14,
+ VBO_ATTRIB_GENERIC15,
/* XXX: in the vertex program inputs_read flag, we alias
* materials and generics and use knowledge about the program
* (whether it is a fixed-function emulation) to
* differentiate. Here we must keep them apart instead.
*/
- VBO_ATTRIB_MAT_FRONT_AMBIENT = 33,
- VBO_ATTRIB_MAT_BACK_AMBIENT = 34,
- VBO_ATTRIB_MAT_FRONT_DIFFUSE = 35,
- VBO_ATTRIB_MAT_BACK_DIFFUSE = 36,
- VBO_ATTRIB_MAT_FRONT_SPECULAR = 37,
- VBO_ATTRIB_MAT_BACK_SPECULAR = 38,
- VBO_ATTRIB_MAT_FRONT_EMISSION = 39,
- VBO_ATTRIB_MAT_BACK_EMISSION = 40,
- VBO_ATTRIB_MAT_FRONT_SHININESS = 41,
- VBO_ATTRIB_MAT_BACK_SHININESS = 42,
- VBO_ATTRIB_MAT_FRONT_INDEXES = 43,
- VBO_ATTRIB_MAT_BACK_INDEXES = 44,
+ VBO_ATTRIB_MAT_FRONT_AMBIENT,
+ VBO_ATTRIB_MAT_BACK_AMBIENT,
+ VBO_ATTRIB_MAT_FRONT_DIFFUSE,
+ VBO_ATTRIB_MAT_BACK_DIFFUSE,
+ VBO_ATTRIB_MAT_FRONT_SPECULAR,
+ VBO_ATTRIB_MAT_BACK_SPECULAR,
+ VBO_ATTRIB_MAT_FRONT_EMISSION,
+ VBO_ATTRIB_MAT_BACK_EMISSION,
+ VBO_ATTRIB_MAT_FRONT_SHININESS,
+ VBO_ATTRIB_MAT_BACK_SHININESS,
+ VBO_ATTRIB_MAT_FRONT_INDEXES,
+ VBO_ATTRIB_MAT_BACK_INDEXES,
- VBO_ATTRIB_MAX = 45
+ VBO_ATTRIB_MAX
};
#define VBO_ATTRIB_FIRST_MATERIAL VBO_ATTRIB_MAT_FRONT_AMBIENT