Continue reducing dependencies on core mesa include files.
[mesa.git] / src / mesa / pipe / tgsi / core / tgsi_build.h
1 #if !defined TGSI_BUILD_H
2 #define TGSI_BUILD_H
3
4 #if defined __cplusplus
5 extern "C" {
6 #endif // defined __cplusplus
7
8 /*
9 * version
10 */
11
12 struct tgsi_version
13 tgsi_build_version( void );
14
15 /*
16 * header
17 */
18
19 struct tgsi_header
20 tgsi_build_header( void );
21
22 struct tgsi_processor
23 tgsi_default_processor( void );
24
25 struct tgsi_processor
26 tgsi_build_processor(
27 unsigned processor,
28 struct tgsi_header *header );
29
30 /*
31 * declaration
32 */
33
34 struct tgsi_declaration
35 tgsi_default_declaration( void );
36
37 struct tgsi_declaration
38 tgsi_build_declaration(
39 unsigned file,
40 unsigned declare,
41 unsigned interpolate,
42 struct tgsi_header *header );
43
44 struct tgsi_full_declaration
45 tgsi_default_full_declaration( void );
46
47 unsigned
48 tgsi_build_full_declaration(
49 const struct tgsi_full_declaration *full_decl,
50 struct tgsi_token *tokens,
51 struct tgsi_header *header,
52 unsigned maxsize );
53
54 struct tgsi_declaration_range
55 tgsi_build_declaration_range(
56 unsigned first,
57 unsigned last,
58 struct tgsi_declaration *declaration,
59 struct tgsi_header *header );
60
61 struct tgsi_declaration_mask
62 tgsi_build_declaration_mask(
63 unsigned mask,
64 struct tgsi_declaration *declaration,
65 struct tgsi_header *header );
66
67 struct tgsi_declaration_interpolation
68 tgsi_default_declaration_interpolation( void );
69
70 struct tgsi_declaration_interpolation
71 tgsi_build_declaration_interpolation(
72 unsigned interpolate,
73 struct tgsi_declaration *declaration,
74 struct tgsi_header *header );
75
76 /*
77 * immediate
78 */
79
80 struct tgsi_immediate
81 tgsi_default_immediate( void );
82
83 struct tgsi_immediate
84 tgsi_build_immediate(
85 struct tgsi_header *header );
86
87 struct tgsi_full_immediate
88 tgsi_default_full_immediate( void );
89
90 struct tgsi_immediate_float32
91 tgsi_build_immediate_float32(
92 float value,
93 struct tgsi_immediate *immediate,
94 struct tgsi_header *header );
95
96 unsigned
97 tgsi_build_full_immediate(
98 const struct tgsi_full_immediate *full_imm,
99 struct tgsi_token *tokens,
100 struct tgsi_header *header,
101 unsigned maxsize );
102
103 /*
104 * instruction
105 */
106
107 struct tgsi_instruction
108 tgsi_default_instruction( void );
109
110 struct tgsi_instruction
111 tgsi_build_instruction(
112 unsigned opcode,
113 unsigned saturate,
114 unsigned num_dst_regs,
115 unsigned num_src_regs,
116 struct tgsi_header *header );
117
118 struct tgsi_full_instruction
119 tgsi_default_full_instruction( void );
120
121 unsigned
122 tgsi_build_full_instruction(
123 const struct tgsi_full_instruction *full_inst,
124 struct tgsi_token *tokens,
125 struct tgsi_header *header,
126 unsigned maxsize );
127
128 struct tgsi_instruction_ext_nv
129 tgsi_default_instruction_ext_nv( void );
130
131 unsigned
132 tgsi_compare_instruction_ext_nv(
133 struct tgsi_instruction_ext_nv a,
134 struct tgsi_instruction_ext_nv b );
135
136 struct tgsi_instruction_ext_nv
137 tgsi_build_instruction_ext_nv(
138 unsigned precision,
139 unsigned cond_dst_index,
140 unsigned cond_flow_index,
141 unsigned cond_mask,
142 unsigned cond_swizzle_x,
143 unsigned cond_swizzle_y,
144 unsigned cond_swizzle_z,
145 unsigned cond_swizzle_w,
146 unsigned cond_dst_update,
147 unsigned cond_flow_update,
148 struct tgsi_token *prev_token,
149 struct tgsi_instruction *instruction,
150 struct tgsi_header *header );
151
152 struct tgsi_instruction_ext_label
153 tgsi_default_instruction_ext_label( void );
154
155 unsigned
156 tgsi_compare_instruction_ext_label(
157 struct tgsi_instruction_ext_label a,
158 struct tgsi_instruction_ext_label b );
159
160 struct tgsi_instruction_ext_label
161 tgsi_build_instruction_ext_label(
162 unsigned label,
163 struct tgsi_token *prev_token,
164 struct tgsi_instruction *instruction,
165 struct tgsi_header *header );
166
167 struct tgsi_instruction_ext_texture
168 tgsi_default_instruction_ext_texture( void );
169
170 unsigned
171 tgsi_compare_instruction_ext_texture(
172 struct tgsi_instruction_ext_texture a,
173 struct tgsi_instruction_ext_texture b );
174
175 struct tgsi_instruction_ext_texture
176 tgsi_build_instruction_ext_texture(
177 unsigned texture,
178 struct tgsi_token *prev_token,
179 struct tgsi_instruction *instruction,
180 struct tgsi_header *header );
181
182 struct tgsi_src_register
183 tgsi_default_src_register( void );
184
185 struct tgsi_src_register
186 tgsi_build_src_register(
187 unsigned file,
188 unsigned swizzle_x,
189 unsigned swizzle_y,
190 unsigned swizzle_z,
191 unsigned swizzle_w,
192 unsigned negate,
193 unsigned indirect,
194 unsigned dimension,
195 int index,
196 struct tgsi_instruction *instruction,
197 struct tgsi_header *header );
198
199 struct tgsi_full_src_register
200 tgsi_default_full_src_register( void );
201
202 struct tgsi_src_register_ext_swz
203 tgsi_default_src_register_ext_swz( void );
204
205 unsigned
206 tgsi_compare_src_register_ext_swz(
207 struct tgsi_src_register_ext_swz a,
208 struct tgsi_src_register_ext_swz b );
209
210 struct tgsi_src_register_ext_swz
211 tgsi_build_src_register_ext_swz(
212 unsigned ext_swizzle_x,
213 unsigned ext_swizzle_y,
214 unsigned ext_swizzle_z,
215 unsigned ext_swizzle_w,
216 unsigned negate_x,
217 unsigned negate_y,
218 unsigned negate_z,
219 unsigned negate_w,
220 unsigned ext_divide,
221 struct tgsi_token *prev_token,
222 struct tgsi_instruction *instruction,
223 struct tgsi_header *header );
224
225 struct tgsi_src_register_ext_mod
226 tgsi_default_src_register_ext_mod( void );
227
228 unsigned
229 tgsi_compare_src_register_ext_mod(
230 struct tgsi_src_register_ext_mod a,
231 struct tgsi_src_register_ext_mod b );
232
233 struct tgsi_src_register_ext_mod
234 tgsi_build_src_register_ext_mod(
235 unsigned complement,
236 unsigned bias,
237 unsigned scale_2x,
238 unsigned absolute,
239 unsigned negate,
240 struct tgsi_token *prev_token,
241 struct tgsi_instruction *instruction,
242 struct tgsi_header *header );
243
244 struct tgsi_dimension
245 tgsi_default_dimension( void );
246
247 struct tgsi_dimension
248 tgsi_build_dimension(
249 unsigned indirect,
250 unsigned index,
251 struct tgsi_instruction *instruction,
252 struct tgsi_header *header );
253
254 struct tgsi_dst_register
255 tgsi_default_dst_register( void );
256
257 struct tgsi_dst_register
258 tgsi_build_dst_register(
259 unsigned file,
260 unsigned mask,
261 int index,
262 struct tgsi_instruction *instruction,
263 struct tgsi_header *header );
264
265 struct tgsi_full_dst_register
266 tgsi_default_full_dst_register( void );
267
268 struct tgsi_dst_register_ext_concode
269 tgsi_default_dst_register_ext_concode( void );
270
271 unsigned
272 tgsi_compare_dst_register_ext_concode(
273 struct tgsi_dst_register_ext_concode a,
274 struct tgsi_dst_register_ext_concode b );
275
276 struct tgsi_dst_register_ext_concode
277 tgsi_build_dst_register_ext_concode(
278 unsigned cc,
279 unsigned swizzle_x,
280 unsigned swizzle_y,
281 unsigned swizzle_z,
282 unsigned swizzle_w,
283 int index,
284 struct tgsi_token *prev_token,
285 struct tgsi_instruction *instruction,
286 struct tgsi_header *header );
287
288 struct tgsi_dst_register_ext_modulate
289 tgsi_default_dst_register_ext_modulate( void );
290
291 unsigned
292 tgsi_compare_dst_register_ext_modulate(
293 struct tgsi_dst_register_ext_modulate a,
294 struct tgsi_dst_register_ext_modulate b );
295
296 struct tgsi_dst_register_ext_modulate
297 tgsi_build_dst_register_ext_modulate(
298 unsigned modulate,
299 struct tgsi_token *prev_token,
300 struct tgsi_instruction *instruction,
301 struct tgsi_header *header );
302
303 #if defined __cplusplus
304 } // extern "C"
305 #endif // defined __cplusplus
306
307 #endif // !defined TGSI_BUILD_H
308