1 /*
2  * Copyright (C) 2009 Francisco Jerez.
3  * All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial
15  * portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  */
26 
27 #ifndef __NOUVEAU_STATE_H__
28 #define __NOUVEAU_STATE_H__
29 
30 enum {
31 	NOUVEAU_STATE_ALPHA_FUNC,
32 	NOUVEAU_STATE_BLEND_COLOR,
33 	NOUVEAU_STATE_BLEND_EQUATION,
34 	NOUVEAU_STATE_BLEND_FUNC,
35 	NOUVEAU_STATE_CLIP_PLANE0,
36 	NOUVEAU_STATE_CLIP_PLANE1,
37 	NOUVEAU_STATE_CLIP_PLANE2,
38 	NOUVEAU_STATE_CLIP_PLANE3,
39 	NOUVEAU_STATE_CLIP_PLANE4,
40 	NOUVEAU_STATE_CLIP_PLANE5,
41 	NOUVEAU_STATE_COLOR_MASK,
42 	NOUVEAU_STATE_COLOR_MATERIAL,
43 	NOUVEAU_STATE_CULL_FACE,
44 	NOUVEAU_STATE_FRONT_FACE,
45 	NOUVEAU_STATE_DEPTH,
46 	NOUVEAU_STATE_DITHER,
47 	NOUVEAU_STATE_FRAG,
48 	NOUVEAU_STATE_FRAMEBUFFER,
49 	NOUVEAU_STATE_FOG,
50 	NOUVEAU_STATE_LIGHT_ENABLE,
51 	NOUVEAU_STATE_LIGHT_MODEL,
52 	NOUVEAU_STATE_LIGHT_SOURCE0,
53 	NOUVEAU_STATE_LIGHT_SOURCE1,
54 	NOUVEAU_STATE_LIGHT_SOURCE2,
55 	NOUVEAU_STATE_LIGHT_SOURCE3,
56 	NOUVEAU_STATE_LIGHT_SOURCE4,
57 	NOUVEAU_STATE_LIGHT_SOURCE5,
58 	NOUVEAU_STATE_LIGHT_SOURCE6,
59 	NOUVEAU_STATE_LIGHT_SOURCE7,
60 	NOUVEAU_STATE_LINE_STIPPLE,
61 	NOUVEAU_STATE_LINE_MODE,
62 	NOUVEAU_STATE_LOGIC_OPCODE,
63 	NOUVEAU_STATE_MATERIAL_FRONT_AMBIENT,
64 	NOUVEAU_STATE_MATERIAL_BACK_AMBIENT,
65 	NOUVEAU_STATE_MATERIAL_FRONT_DIFFUSE,
66 	NOUVEAU_STATE_MATERIAL_BACK_DIFFUSE,
67 	NOUVEAU_STATE_MATERIAL_FRONT_SPECULAR,
68 	NOUVEAU_STATE_MATERIAL_BACK_SPECULAR,
69 	NOUVEAU_STATE_MATERIAL_FRONT_SHININESS,
70 	NOUVEAU_STATE_MATERIAL_BACK_SHININESS,
71 	NOUVEAU_STATE_MODELVIEW,
72 	NOUVEAU_STATE_POINT_MODE,
73 	NOUVEAU_STATE_POINT_PARAMETER,
74 	NOUVEAU_STATE_POLYGON_MODE,
75 	NOUVEAU_STATE_POLYGON_OFFSET,
76 	NOUVEAU_STATE_POLYGON_STIPPLE,
77 	NOUVEAU_STATE_PROJECTION,
78 	NOUVEAU_STATE_RENDER_MODE,
79 	NOUVEAU_STATE_SCISSOR,
80 	NOUVEAU_STATE_SHADE_MODEL,
81 	NOUVEAU_STATE_STENCIL_FUNC,
82 	NOUVEAU_STATE_STENCIL_MASK,
83 	NOUVEAU_STATE_STENCIL_OP,
84 	NOUVEAU_STATE_TEX_ENV0,
85 	NOUVEAU_STATE_TEX_ENV1,
86 	NOUVEAU_STATE_TEX_ENV2,
87 	NOUVEAU_STATE_TEX_ENV3,
88 	NOUVEAU_STATE_TEX_GEN0,
89 	NOUVEAU_STATE_TEX_GEN1,
90 	NOUVEAU_STATE_TEX_GEN2,
91 	NOUVEAU_STATE_TEX_GEN3,
92 	NOUVEAU_STATE_TEX_MAT0,
93 	NOUVEAU_STATE_TEX_MAT1,
94 	NOUVEAU_STATE_TEX_MAT2,
95 	NOUVEAU_STATE_TEX_MAT3,
96 	NOUVEAU_STATE_TEX_OBJ0,
97 	NOUVEAU_STATE_TEX_OBJ1,
98 	NOUVEAU_STATE_TEX_OBJ2,
99 	NOUVEAU_STATE_TEX_OBJ3,
100 	NOUVEAU_STATE_VIEWPORT,
101 	NUM_NOUVEAU_STATE,
102 
103 	/* Room for card-specific states. */
104 
105 	MAX_NOUVEAU_STATE = NUM_NOUVEAU_STATE + 16,
106 };
107 
108 typedef void (*nouveau_state_func)(struct gl_context *ctx, int emit);
109 
110 void
111 nouveau_state_init(struct gl_context *ctx);
112 
113 void
114 nouveau_emit_nothing(struct gl_context *ctx, int emit);
115 
116 int
117 nouveau_next_dirty_state(struct gl_context *ctx);
118 
119 void
120 nouveau_state_emit(struct gl_context *ctx);
121 
122 #endif
123