Start beginning of pixel shader generator..
[mesa.git] / src / mesa / drivers / dri / r300 / r300_fixed_pipelines.h
1 #ifndef __R300_FIXED_PIPELINES_H__
2 #define __R300_FIXED_PIPELINES_H__
3
4 /******** Flat color pipeline **********/
5 static struct r300_vertex_shader_state FLAT_COLOR_VERTEX_SHADER={
6 program: {
7 length: 20,
8
9 body:{ d: {
10 EASY_VSF_OP(MUL, 0, ALL, TMP),
11 VSF_PARAM(3),
12 VSF_ATTR_W(0),
13 EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE),
14
15 EASY_VSF_OP(MUL, 1, ALL, RESULT),
16 VSF_REG(1),
17 VSF_ATTR_UNITY(1),
18 VSF_UNITY(1),
19
20 EASY_VSF_OP(MAD, 0, ALL, TMP),
21 VSF_PARAM(2),
22 VSF_ATTR_Z(0),
23 VSF_TMP(0),
24
25 EASY_VSF_OP(MAD, 0, ALL, TMP),
26 VSF_PARAM(1),
27 VSF_ATTR_Y(0),
28 VSF_TMP(0),
29
30 EASY_VSF_OP(MAD, 0, ALL, RESULT),
31 VSF_PARAM(0),
32 VSF_ATTR_X(0),
33 VSF_TMP(0),
34 } }
35 },
36
37 matrix:{
38 {
39 length: 16,
40 body: { f: {
41 2.0,
42 0,
43 0.0,
44 0.0,
45 0,
46 2.5,
47 0,
48 0,
49 0.0,
50 0,
51 -1.00,
52 -1.0,
53 -3.0,
54 0,
55 6.0,
56 6.0
57 } }
58 },
59 {
60 length: 0,
61 },
62 {
63 length: 0,
64 }
65 },
66
67 vector: {
68 {
69 length: 0,
70 },
71 {
72 length: 0,
73 }
74 },
75
76 unknown1: {
77 length: 0
78 },
79
80 unknown2: {
81 length: 0
82 },
83
84 program_start: 0,
85 unknown_ptr1: 4,
86 program_end: 4,
87
88 param_offset: 0,
89 param_count: 4,
90
91 unknown_ptr2: 0,
92 unknown_ptr3: 4
93 };
94
95 static struct r300_pixel_shader_state FLAT_COLOR_PIXEL_SHADER={
96 program: {
97 tex: {
98 length: 0
99 },
100 alu: {
101 length: 1,
102 /* My understanding is that we need at least 1 instructions for pixel shader,
103 in particular because alu_end==0 means there is one instruction */
104 inst: {
105 PFS_NOP
106 }
107 },
108 node: {
109 { 0, 0, 0, 0},
110 { 0, 0, 0, 0},
111 { 0, 0, 0, 0},
112 { 0, 0, 0, 0}
113 },
114 active_nodes: 1,
115 first_node_has_tex: 0,
116 temp_register_count: 0,
117
118 tex_offset: 0,
119 tex_end: 0,
120 alu_offset: 0,
121 alu_end: 0
122 },
123
124 param_length: 0
125 };
126
127
128 /******** Single texture pipeline ***********/
129 static struct r300_vertex_shader_state SINGLE_TEXTURE_VERTEX_SHADER={
130 program: {
131 length: 24,
132
133 body: { d: {
134 EASY_VSF_OP(MUL, 0, ALL, TMP),
135 VSF_PARAM(3),
136 VSF_ATTR_W(0),
137 EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE),
138
139 EASY_VSF_OP(MUL, 2, ALL, RESULT),
140 VSF_REG(2),
141 VSF_ATTR_UNITY(2),
142 VSF_UNITY(2),
143
144 EASY_VSF_OP(MAD, 0, ALL, TMP),
145 VSF_PARAM(2),
146 VSF_ATTR_Z(0),
147 VSF_TMP(0),
148
149 EASY_VSF_OP(MUL, 1, ALL, RESULT),
150 VSF_REG(1),
151 VSF_ATTR_UNITY(1),
152 VSF_UNITY(1),
153
154 EASY_VSF_OP(MAD, 0, ALL, TMP),
155 VSF_PARAM(1),
156 VSF_ATTR_Y(0),
157 VSF_TMP(0),
158
159 EASY_VSF_OP(MAD, 0, ALL, RESULT),
160 VSF_PARAM(0),
161 VSF_ATTR_X(0),
162 VSF_TMP(0),
163 } }
164 },
165
166 matrix:{
167 {
168 length: 16,
169 body: { f: {
170 2.0,
171 0,
172 0.0,
173 0.0,
174 0,
175 2.5,
176 0,
177 0,
178 0.0,
179 0,
180 -1.00,
181 -1.0,
182 -3.0,
183 0,
184 6.0,
185 6.0
186 } }
187 },
188 {
189 length: 0,
190 },
191 {
192 length: 0,
193 }
194 },
195
196 vector: {
197 {
198 length: 0,
199 },
200 {
201 length: 0,
202 }
203 },
204
205 unknown1: {
206 length: 0
207 },
208
209 unknown2: {
210 length: 4,
211 body: { f: {
212 0.0,
213 0.0,
214 1.0,
215 0.0
216 } }
217 },
218
219 program_start: 0,
220 unknown_ptr1: 5,
221 program_end: 5,
222
223 param_offset: 0,
224 param_count: 4,
225
226 unknown_ptr2: 0,
227 unknown_ptr3: 5
228 };
229
230 static struct r300_pixel_shader_state SINGLE_TEXTURE_PIXEL_SHADER={
231 program: {
232 tex: {
233 length: 1,
234 inst: { 0x00018000 }
235 },
236 alu: {
237 length: 1,
238 inst:
239 {
240 /* What are 0's ORed with flags ? They are register numbers that
241 just happen to be 0 */
242 {
243 EASY_PFS_INSTR0(MAD, SRC0C_XYZ, SRC1C_XYZ, ZERO),
244 EASY_PFS_INSTR1(0, 0, 1, 0 | PFS_FLAG_CONST, NONE, ALL),
245
246 #if 0
247 /* no alpha in textures */
248 EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO),
249 EASY_PFS_INSTR3(0, 1, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, OUTPUT)
250 #endif
251
252 /* alpha in textures */
253 EASY_PFS_INSTR2(MAD, SRC0A, SRC1A, ZERO),
254 EASY_PFS_INSTR3(0, 0, 1, 0 | PFS_FLAG_CONST, OUTPUT)
255 }
256 }
257 },
258 node: {
259 { 0, 0, 0, 0},
260 { 0, 0, 0, 0},
261 { 0, 0, 0, 0},
262 { 0, 0, 0, 0}
263 },
264
265 active_nodes: 1,
266 first_node_has_tex: 1,
267 temp_register_count: 1,
268
269 tex_offset: 0,
270 tex_end: 0,
271 alu_offset: 0,
272 alu_end: 0
273 },
274
275 param_length: 8,
276 param: {
277 { 0.0, 0.0, 0.0, 0.0},
278 { 0.0, 0.0, 0.0, 0.0},
279 { 0.0, 0.0, 0.0, 0.0},
280 { 0.0, 0.0, 0.0, 0.0},
281 { 0.0, 0.0, 0.0, 0.0},
282 { 0.0, 0.0, 0.0, 0.0},
283 { 0.0, 0.0, 0.0, 0.0},
284 { 0.0, 0.0, 0.0, 0.0}
285 }
286 };
287
288 #endif