1 /*
2  Copyright (C) Intel Corp.  2006.  All Rights Reserved.
3  Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4  develop this 3D driver.
5 
6  Permission is hereby granted, free of charge, to any person obtaining
7  a copy of this software and associated documentation files (the
8  "Software"), to deal in the Software without restriction, including
9  without limitation the rights to use, copy, modify, merge, publish,
10  distribute, sublicense, and/or sell copies of the Software, and to
11  permit persons to whom the Software is furnished to do so, subject to
12  the following conditions:
13 
14  The above copyright notice and this permission notice (including the
15  next paragraph) shall be included in all copies or substantial
16  portions of the Software.
17 
18  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 
26  **********************************************************************/
27  /*
28   * Authors:
29   *   Keith Whitwell <keith@tungstengraphics.com>
30   */
31 
32 #ifndef VBO_ATTRIB_H
33 #define VBO_ATTRIB_H
34 
35 
36 /*
37  * Note: The first attributes match the VERT_ATTRIB_* definitions
38  * in mtypes.h.  However, the tnl module has additional attributes
39  * for materials, color indexes, edge flags, etc.
40  */
41 /* Although it's nice to use these as bit indexes in a DWORD flag, we
42  * could manage without if necessary.  Another limit currently is the
43  * number of bits allocated for these numbers in places like vertex
44  * program instruction formats and register layouts.
45  */
46 enum {
47 	VBO_ATTRIB_POS = 0,
48 	VBO_ATTRIB_WEIGHT = 1,
49 	VBO_ATTRIB_NORMAL = 2,
50 	VBO_ATTRIB_COLOR0 = 3,
51 	VBO_ATTRIB_COLOR1 = 4,
52 	VBO_ATTRIB_FOG = 5,
53 	VBO_ATTRIB_INDEX = 6,
54 	VBO_ATTRIB_EDGEFLAG = 7,
55 	VBO_ATTRIB_TEX0 = 8,
56 	VBO_ATTRIB_TEX1 = 9,
57 	VBO_ATTRIB_TEX2 = 10,
58 	VBO_ATTRIB_TEX3 = 11,
59 	VBO_ATTRIB_TEX4 = 12,
60 	VBO_ATTRIB_TEX5 = 13,
61 	VBO_ATTRIB_TEX6 = 14,
62 	VBO_ATTRIB_TEX7 = 15,
63 	VBO_ATTRIB_POINT_SIZE = 16,
64 
65 	VBO_ATTRIB_GENERIC0 = 17, /* Not used? */
66 	VBO_ATTRIB_GENERIC1 = 18,
67 	VBO_ATTRIB_GENERIC2 = 19,
68 	VBO_ATTRIB_GENERIC3 = 20,
69 	VBO_ATTRIB_GENERIC4 = 21,
70 	VBO_ATTRIB_GENERIC5 = 22,
71 	VBO_ATTRIB_GENERIC6 = 23,
72 	VBO_ATTRIB_GENERIC7 = 24,
73 	VBO_ATTRIB_GENERIC8 = 25,
74 	VBO_ATTRIB_GENERIC9 = 26,
75 	VBO_ATTRIB_GENERIC10 = 27,
76 	VBO_ATTRIB_GENERIC11 = 28,
77 	VBO_ATTRIB_GENERIC12 = 29,
78 	VBO_ATTRIB_GENERIC13 = 30,
79 	VBO_ATTRIB_GENERIC14 = 31,
80 	VBO_ATTRIB_GENERIC15 = 32,
81 
82 	/* XXX: in the vertex program InputsRead flag, we alias
83 	 * materials and generics and use knowledge about the program
84 	 * (whether it is a fixed-function emulation) to
85 	 * differentiate.  Here we must keep them apart instead.
86 	 */
87 	VBO_ATTRIB_MAT_FRONT_AMBIENT = 33,
88 	VBO_ATTRIB_MAT_BACK_AMBIENT = 34,
89 	VBO_ATTRIB_MAT_FRONT_DIFFUSE = 35,
90 	VBO_ATTRIB_MAT_BACK_DIFFUSE = 36,
91 	VBO_ATTRIB_MAT_FRONT_SPECULAR = 37,
92 	VBO_ATTRIB_MAT_BACK_SPECULAR = 38,
93 	VBO_ATTRIB_MAT_FRONT_EMISSION = 39,
94 	VBO_ATTRIB_MAT_BACK_EMISSION = 40,
95 	VBO_ATTRIB_MAT_FRONT_SHININESS = 41,
96 	VBO_ATTRIB_MAT_BACK_SHININESS = 42,
97 	VBO_ATTRIB_MAT_FRONT_INDEXES = 43,
98 	VBO_ATTRIB_MAT_BACK_INDEXES = 44,
99 
100 	VBO_ATTRIB_MAX = 45
101 };
102 
103 #define VBO_ATTRIB_FIRST_MATERIAL VBO_ATTRIB_MAT_FRONT_AMBIENT
104 #define VBO_ATTRIB_LAST_MATERIAL VBO_ATTRIB_MAT_BACK_INDEXES
105 
106 #define VBO_MAX_COPIED_VERTS 3
107 
108 #endif
109