gallivm/draw/swr: make the gs_iface not depend on tgsi.
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_tgsi.h
1 /**************************************************************************
2 *
3 * Copyright 2011-2012 Advanced Micro Devices, Inc.
4 * Copyright 2009 VMware, Inc.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
17 * of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 *
27 **************************************************************************/
28
29 /**
30 * @file
31 * TGSI to LLVM IR translation.
32 *
33 * @author Jose Fonseca <jfonseca@vmware.com>
34 * @author Tom Stellard <thomas.stellard@amd.com>
35 */
36
37 #ifndef LP_BLD_TGSI_H
38 #define LP_BLD_TGSI_H
39
40 #include "gallivm/lp_bld.h"
41 #include "gallivm/lp_bld_tgsi_action.h"
42 #include "gallivm/lp_bld_limits.h"
43 #include "gallivm/lp_bld_sample.h"
44 #include "lp_bld_type.h"
45 #include "pipe/p_compiler.h"
46 #include "pipe/p_state.h"
47 #include "tgsi/tgsi_exec.h"
48 #include "tgsi/tgsi_scan.h"
49 #include "tgsi/tgsi_info.h"
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 #define LP_CHAN_ALL ~0u
56
57 #define LP_MAX_INSTRUCTIONS 256
58
59 struct tgsi_full_declaration;
60 struct tgsi_full_immediate;
61 struct tgsi_full_instruction;
62 struct tgsi_full_src_register;
63 struct tgsi_opcode_info;
64 struct tgsi_token;
65 struct tgsi_shader_info;
66 struct lp_build_mask_context;
67 struct gallivm_state;
68 struct lp_derivatives;
69 struct lp_build_gs_iface;
70
71 enum lp_build_tex_modifier {
72 LP_BLD_TEX_MODIFIER_NONE = 0,
73 LP_BLD_TEX_MODIFIER_PROJECTED,
74 LP_BLD_TEX_MODIFIER_LOD_BIAS,
75 LP_BLD_TEX_MODIFIER_EXPLICIT_LOD,
76 LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV,
77 LP_BLD_TEX_MODIFIER_LOD_ZERO
78 };
79
80
81 /**
82 * Describe a channel of a register.
83 *
84 * The value can be a:
85 * - immediate value (i.e. derived from a IMM register)
86 * - CONST[n].x/y/z/w
87 * - IN[n].x/y/z/w
88 * - undetermined (when .file == TGSI_FILE_NULL)
89 *
90 * This is one of the analysis results, and is used to described
91 * the output color in terms of inputs.
92 */
93 struct lp_tgsi_channel_info
94 {
95 unsigned file:4; /* TGSI_FILE_* */
96 unsigned swizzle:3; /* PIPE_SWIZZLE_x */
97 union {
98 uint32_t index;
99 float value; /* for TGSI_FILE_IMMEDIATE */
100 } u;
101 };
102
103
104 /**
105 * Describe a texture sampler interpolator.
106 *
107 * The interpolation is described in terms of regular inputs.
108 */
109 struct lp_tgsi_texture_info
110 {
111 struct lp_tgsi_channel_info coord[4];
112 unsigned target:8; /* TGSI_TEXTURE_* */
113 unsigned sampler_unit:8; /* Sampler unit */
114 unsigned texture_unit:8; /* Texture unit */
115 unsigned modifier:8; /* LP_BLD_TEX_MODIFIER_* */
116 };
117
118
119 struct lp_tgsi_info
120 {
121 struct tgsi_shader_info base;
122
123 /*
124 * Whether any of the texture opcodes access a register file other than
125 * TGSI_FILE_INPUT.
126 *
127 * We could also handle TGSI_FILE_CONST/IMMEDIATE here, but there is little
128 * benefit.
129 */
130 unsigned indirect_textures:1;
131
132 /*
133 * Whether any of the texture (sample) ocpodes use different sampler
134 * and sampler view unit.
135 */
136 unsigned sampler_texture_units_different:1;
137
138 /*
139 * Whether any immediate values are outside the range of 0 and 1
140 */
141 unsigned unclamped_immediates:1;
142
143 /*
144 * Texture opcode description. Aimed at detecting and described direct
145 * texture opcodes.
146 */
147 unsigned num_texs;
148 struct lp_tgsi_texture_info tex[PIPE_MAX_SAMPLERS];
149
150 /*
151 * Output description. Aimed at detecting and describing simple blit
152 * shaders.
153 */
154 struct lp_tgsi_channel_info output[PIPE_MAX_SHADER_OUTPUTS][4];
155
156 /*
157 * Shortcut pointers into the above (for fragment shaders).
158 */
159 const struct lp_tgsi_channel_info *cbuf[PIPE_MAX_COLOR_BUFS];
160 };
161
162 /**
163 * Reference to system values.
164 */
165 struct lp_bld_tgsi_system_values {
166 LLVMValueRef instance_id;
167 LLVMValueRef vertex_id;
168 LLVMValueRef vertex_id_nobase;
169 LLVMValueRef prim_id;
170 LLVMValueRef basevertex;
171 LLVMValueRef invocation_id;
172 LLVMValueRef thread_id;
173 LLVMValueRef block_id;
174 LLVMValueRef grid_size;
175 };
176
177
178 /**
179 * Sampler code generation interface.
180 *
181 * Although texture sampling is a requirement for TGSI translation, it is
182 * a very different problem with several different approaches to it. This
183 * structure establishes an interface for texture sampling code generation, so
184 * that we can easily use different texture sampling strategies.
185 */
186 struct lp_build_sampler_soa
187 {
188 void
189 (*destroy)( struct lp_build_sampler_soa *sampler );
190
191 void
192 (*emit_tex_sample)(const struct lp_build_sampler_soa *sampler,
193 struct gallivm_state *gallivm,
194 const struct lp_sampler_params *params);
195
196 void
197 (*emit_size_query)( const struct lp_build_sampler_soa *sampler,
198 struct gallivm_state *gallivm,
199 const struct lp_sampler_size_query_params *params);
200 };
201
202
203 struct lp_build_sampler_aos
204 {
205 LLVMValueRef
206 (*emit_fetch_texel)( const struct lp_build_sampler_aos *sampler,
207 struct lp_build_context *bld,
208 unsigned target, /* TGSI_TEXTURE_* */
209 unsigned unit,
210 LLVMValueRef coords,
211 const struct lp_derivatives derivs,
212 enum lp_build_tex_modifier modifier);
213 };
214
215 struct lp_img_params;
216
217 struct lp_build_image_soa
218 {
219 void
220 (*destroy)( struct lp_build_image_soa *image );
221
222 void
223 (*emit_op)(const struct lp_build_image_soa *image,
224 struct gallivm_state *gallivm,
225 const struct lp_img_params *params);
226
227 void
228 (*emit_size_query)( const struct lp_build_image_soa *sampler,
229 struct gallivm_state *gallivm,
230 const struct lp_sampler_size_query_params *params);
231 };
232
233 void
234 lp_build_tgsi_info(const struct tgsi_token *tokens,
235 struct lp_tgsi_info *info);
236
237
238 struct lp_build_tgsi_params {
239 struct lp_type type;
240 struct lp_build_mask_context *mask;
241 LLVMValueRef consts_ptr;
242 LLVMValueRef const_sizes_ptr;
243 const struct lp_bld_tgsi_system_values *system_values;
244 const LLVMValueRef (*inputs)[4];
245 LLVMValueRef context_ptr;
246 LLVMValueRef thread_data_ptr;
247 const struct lp_build_sampler_soa *sampler;
248 const struct tgsi_shader_info *info;
249 const struct lp_build_gs_iface *gs_iface;
250 LLVMValueRef ssbo_ptr;
251 LLVMValueRef ssbo_sizes_ptr;
252 const struct lp_build_image_soa *image;
253 LLVMValueRef shared_ptr;
254 const struct lp_build_coro_suspend_info *coro;
255 };
256
257 void
258 lp_build_tgsi_soa(struct gallivm_state *gallivm,
259 const struct tgsi_token *tokens,
260 const struct lp_build_tgsi_params *params,
261 LLVMValueRef (*outputs)[4]);
262
263 void
264 lp_build_tgsi_aos(struct gallivm_state *gallivm,
265 const struct tgsi_token *tokens,
266 struct lp_type type,
267 const unsigned char swizzles[4],
268 LLVMValueRef consts_ptr,
269 const LLVMValueRef *inputs,
270 LLVMValueRef *outputs,
271 const struct lp_build_sampler_aos *sampler,
272 const struct tgsi_shader_info *info);
273
274
275 enum lp_exec_mask_break_type {
276 LP_EXEC_MASK_BREAK_TYPE_LOOP,
277 LP_EXEC_MASK_BREAK_TYPE_SWITCH
278 };
279
280
281 struct lp_exec_mask {
282 struct lp_build_context *bld;
283
284 boolean has_mask;
285 boolean ret_in_main;
286
287 LLVMTypeRef int_vec_type;
288
289 LLVMValueRef exec_mask;
290
291 LLVMValueRef ret_mask;
292 LLVMValueRef cond_mask;
293 LLVMValueRef switch_mask; /* current switch exec mask */
294 LLVMValueRef cont_mask;
295 LLVMValueRef break_mask;
296
297 struct function_ctx {
298 int pc;
299 LLVMValueRef ret_mask;
300
301 LLVMValueRef cond_stack[LP_MAX_TGSI_NESTING];
302 int cond_stack_size;
303
304 /* keep track if break belongs to switch or loop */
305 enum lp_exec_mask_break_type break_type_stack[LP_MAX_TGSI_NESTING];
306 enum lp_exec_mask_break_type break_type;
307
308 struct {
309 LLVMValueRef switch_val;
310 LLVMValueRef switch_mask;
311 LLVMValueRef switch_mask_default;
312 boolean switch_in_default;
313 unsigned switch_pc;
314 } switch_stack[LP_MAX_TGSI_NESTING];
315 int switch_stack_size;
316 LLVMValueRef switch_val;
317 LLVMValueRef switch_mask_default; /* reverse of switch mask used for default */
318 boolean switch_in_default; /* if switch exec is currently in default */
319 unsigned switch_pc; /* when used points to default or endswitch-1 */
320
321 LLVMValueRef loop_limiter;
322 LLVMBasicBlockRef loop_block;
323 LLVMValueRef break_var;
324 struct {
325 LLVMBasicBlockRef loop_block;
326 LLVMValueRef cont_mask;
327 LLVMValueRef break_mask;
328 LLVMValueRef break_var;
329 } loop_stack[LP_MAX_TGSI_NESTING];
330 int loop_stack_size;
331
332 } *function_stack;
333 int function_stack_size;
334 };
335
336 struct lp_build_tgsi_inst_list
337 {
338 struct tgsi_full_instruction *instructions;
339 uint max_instructions;
340 uint num_instructions;
341 };
342
343 unsigned lp_bld_tgsi_list_init(struct lp_build_tgsi_context * bld_base);
344
345
346 unsigned lp_bld_tgsi_add_instruction(
347 struct lp_build_tgsi_context * bld_base,
348 const struct tgsi_full_instruction *inst_to_add);
349
350
351 struct lp_build_tgsi_context;
352
353
354 typedef LLVMValueRef (*lp_build_emit_fetch_fn)(struct lp_build_tgsi_context *,
355 const struct tgsi_full_src_register *,
356 enum tgsi_opcode_type,
357 unsigned);
358
359 struct lp_build_tgsi_context
360 {
361 struct lp_build_context base;
362
363 struct lp_build_context uint_bld;
364 struct lp_build_context int_bld;
365
366 struct lp_build_context dbl_bld;
367
368 struct lp_build_context uint64_bld;
369 struct lp_build_context int64_bld;
370
371 /** This array stores functions that are used to transform TGSI opcodes to
372 * LLVM instructions.
373 */
374 struct lp_build_tgsi_action op_actions[TGSI_OPCODE_LAST];
375
376 /* TGSI_OPCODE_RSQ is defined as 1 / sqrt( abs(src0.x) ), rsq_action
377 * should compute 1 / sqrt (src0.x) */
378 struct lp_build_tgsi_action rsq_action;
379
380 struct lp_build_tgsi_action sqrt_action;
381
382 struct lp_build_tgsi_action drsq_action;
383
384 struct lp_build_tgsi_action dsqrt_action;
385 const struct tgsi_shader_info *info;
386
387 lp_build_emit_fetch_fn emit_fetch_funcs[TGSI_FILE_COUNT];
388
389 LLVMValueRef (*emit_swizzle)(struct lp_build_tgsi_context *,
390 LLVMValueRef, unsigned, unsigned, unsigned, unsigned);
391
392
393 void (*emit_debug)(struct lp_build_tgsi_context *,
394 const struct tgsi_full_instruction *,
395 const struct tgsi_opcode_info *);
396
397 void (*emit_store)(struct lp_build_tgsi_context *,
398 const struct tgsi_full_instruction *,
399 const struct tgsi_opcode_info *,
400 unsigned index,
401 LLVMValueRef dst[4]);
402
403 void (*emit_declaration)(struct lp_build_tgsi_context *,
404 const struct tgsi_full_declaration *decl);
405
406 void (*emit_immediate)(struct lp_build_tgsi_context *,
407 const struct tgsi_full_immediate *imm);
408
409
410 /* Allow the user to store data in this structure rather than passing it
411 * to every function. */
412 void * userdata;
413
414 boolean soa;
415
416 int pc;
417
418 struct tgsi_full_instruction *instructions;
419 uint max_instructions;
420 uint num_instructions;
421
422 /** This function allows the user to insert some instructions at the
423 * beginning of the program. It is optional and does not need to be
424 * implemented.
425 */
426 void (*emit_prologue)(struct lp_build_tgsi_context*);
427
428 /** This function allows the user to insert some instructions at the end of
429 * the program. This callback is intended to be used for emitting
430 * instructions to handle the export for the output registers, but it can
431 * be used for any purpose. Implementing this function is optiona, but
432 * recommended.
433 */
434 void (*emit_epilogue)(struct lp_build_tgsi_context*);
435 };
436
437 struct lp_build_gs_iface
438 {
439 LLVMValueRef (*fetch_input)(const struct lp_build_gs_iface *gs_iface,
440 struct lp_build_context * bld,
441 boolean is_vindex_indirect,
442 LLVMValueRef vertex_index,
443 boolean is_aindex_indirect,
444 LLVMValueRef attrib_index,
445 LLVMValueRef swizzle_index);
446 void (*emit_vertex)(const struct lp_build_gs_iface *gs_iface,
447 struct lp_build_context * bld,
448 LLVMValueRef (*outputs)[4],
449 LLVMValueRef emitted_vertices_vec);
450 void (*end_primitive)(const struct lp_build_gs_iface *gs_iface,
451 struct lp_build_context * bld,
452 LLVMValueRef total_emitted_vertices_vec,
453 LLVMValueRef verts_per_prim_vec,
454 LLVMValueRef emitted_prims_vec,
455 LLVMValueRef mask_vec);
456 void (*gs_epilogue)(const struct lp_build_gs_iface *gs_iface,
457 LLVMValueRef total_emitted_vertices_vec,
458 LLVMValueRef emitted_prims_vec);
459 };
460
461 struct lp_build_tgsi_soa_context
462 {
463 struct lp_build_tgsi_context bld_base;
464
465 /* Builder for scalar elements of shader's data type (float) */
466 struct lp_build_context elem_bld;
467
468 const struct lp_build_gs_iface *gs_iface;
469 LLVMValueRef emitted_prims_vec_ptr;
470 LLVMValueRef total_emitted_vertices_vec_ptr;
471 LLVMValueRef emitted_vertices_vec_ptr;
472 LLVMValueRef max_output_vertices_vec;
473
474 LLVMValueRef consts_ptr;
475 LLVMValueRef const_sizes_ptr;
476 LLVMValueRef consts[LP_MAX_TGSI_CONST_BUFFERS];
477 LLVMValueRef consts_sizes[LP_MAX_TGSI_CONST_BUFFERS];
478 const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS];
479 LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS];
480 LLVMValueRef context_ptr;
481 LLVMValueRef thread_data_ptr;
482
483 LLVMValueRef ssbo_ptr;
484 LLVMValueRef ssbo_sizes_ptr;
485 LLVMValueRef ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
486 LLVMValueRef ssbo_sizes[LP_MAX_TGSI_SHADER_BUFFERS];
487
488 LLVMValueRef shared_ptr;
489
490 const struct lp_build_coro_suspend_info *coro;
491
492 const struct lp_build_sampler_soa *sampler;
493 const struct lp_build_image_soa *image;
494
495 struct tgsi_declaration_sampler_view sv[PIPE_MAX_SHADER_SAMPLER_VIEWS];
496
497 LLVMValueRef immediates[LP_MAX_INLINED_IMMEDIATES][TGSI_NUM_CHANNELS];
498 LLVMValueRef temps[LP_MAX_INLINED_TEMPS][TGSI_NUM_CHANNELS];
499 LLVMValueRef addr[LP_MAX_TGSI_ADDRS][TGSI_NUM_CHANNELS];
500
501 /* We allocate/use this array of temps if (1 << TGSI_FILE_TEMPORARY) is
502 * set in the indirect_files field.
503 * The temps[] array above is unused then.
504 */
505 LLVMValueRef temps_array;
506
507 /* We allocate/use this array of output if (1 << TGSI_FILE_OUTPUT) is
508 * set in the indirect_files field.
509 * The outputs[] array above is unused then.
510 */
511 LLVMValueRef outputs_array;
512
513 /* We allocate/use this array of inputs if (1 << TGSI_FILE_INPUT) is
514 * set in the indirect_files field.
515 * The inputs[] array above is unused then.
516 */
517 LLVMValueRef inputs_array;
518
519 /* We allocate/use this array of temps if (1 << TGSI_FILE_IMMEDIATE) is
520 * set in the indirect_files field.
521 */
522 LLVMValueRef imms_array;
523
524
525 struct lp_bld_tgsi_system_values system_values;
526
527 /** bitmask indicating which register files are accessed indirectly */
528 unsigned indirect_files;
529
530 struct lp_build_mask_context *mask;
531 struct lp_exec_mask exec_mask;
532
533 uint num_immediates;
534 boolean use_immediates_array;
535 };
536
537 void
538 lp_emit_declaration_soa(
539 struct lp_build_tgsi_context *bld,
540 const struct tgsi_full_declaration *decl);
541
542 void lp_emit_immediate_soa(
543 struct lp_build_tgsi_context *bld_base,
544 const struct tgsi_full_immediate *imm);
545
546 boolean
547 lp_emit_instruction_soa(
548 struct lp_build_tgsi_soa_context *bld,
549 const struct tgsi_full_instruction *inst,
550 const struct tgsi_opcode_info *info);
551
552
553 LLVMValueRef
554 lp_get_temp_ptr_soa(
555 struct lp_build_tgsi_soa_context *bld,
556 unsigned index,
557 unsigned chan);
558
559 LLVMValueRef
560 lp_get_output_ptr(
561 struct lp_build_tgsi_soa_context *bld,
562 unsigned index,
563 unsigned chan);
564
565 struct lp_build_tgsi_aos_context
566 {
567 struct lp_build_tgsi_context bld_base;
568
569 /* Builder for integer masks and indices */
570 struct lp_build_context int_bld;
571
572 /*
573 * AoS swizzle used:
574 * - swizzles[0] = red index
575 * - swizzles[1] = green index
576 * - swizzles[2] = blue index
577 * - swizzles[3] = alpha index
578 */
579 unsigned char swizzles[4];
580 unsigned char inv_swizzles[4];
581
582 LLVMValueRef consts_ptr;
583 const LLVMValueRef *inputs;
584 LLVMValueRef *outputs;
585
586 const struct lp_build_sampler_aos *sampler;
587
588 struct tgsi_declaration_sampler_view sv[PIPE_MAX_SHADER_SAMPLER_VIEWS];
589
590 LLVMValueRef immediates[LP_MAX_INLINED_IMMEDIATES];
591 LLVMValueRef temps[LP_MAX_INLINED_TEMPS];
592 LLVMValueRef addr[LP_MAX_TGSI_ADDRS];
593
594 /* We allocate/use this array of temps if (1 << TGSI_FILE_TEMPORARY) is
595 * set in the indirect_files field.
596 * The temps[] array above is unused then.
597 */
598 LLVMValueRef temps_array;
599
600 /** bitmask indicating which register files are accessed indirectly */
601 unsigned indirect_files;
602
603 };
604
605 static inline struct lp_build_tgsi_soa_context *
606 lp_soa_context(struct lp_build_tgsi_context *bld_base)
607 {
608 return (struct lp_build_tgsi_soa_context *)bld_base;
609 }
610
611 static inline struct lp_build_tgsi_aos_context *
612 lp_aos_context(struct lp_build_tgsi_context *bld_base)
613 {
614 return (struct lp_build_tgsi_aos_context *)bld_base;
615 }
616
617 void
618 lp_emit_declaration_aos(
619 struct lp_build_tgsi_aos_context *bld,
620 const struct tgsi_full_declaration *decl);
621
622
623 boolean
624 lp_emit_instruction_aos(
625 struct lp_build_tgsi_aos_context *bld,
626 const struct tgsi_full_instruction *inst,
627 const struct tgsi_opcode_info *info,
628 int *pc);
629
630 void
631 lp_emit_store_aos(
632 struct lp_build_tgsi_aos_context *bld,
633 const struct tgsi_full_instruction *inst,
634 unsigned index,
635 LLVMValueRef value);
636
637 void lp_build_fetch_args(
638 struct lp_build_tgsi_context * bld_base,
639 struct lp_build_emit_data * emit_data);
640
641 LLVMValueRef
642 lp_build_tgsi_inst_llvm_aos(
643 struct lp_build_tgsi_context * bld_base,
644 const struct tgsi_full_instruction *inst);
645
646 void
647 lp_build_tgsi_intrinsic(
648 const struct lp_build_tgsi_action * action,
649 struct lp_build_tgsi_context * bld_base,
650 struct lp_build_emit_data * emit_data);
651
652 LLVMValueRef
653 lp_build_emit_llvm(
654 struct lp_build_tgsi_context *bld_base,
655 unsigned tgsi_opcode,
656 struct lp_build_emit_data * emit_data);
657
658 LLVMValueRef
659 lp_build_emit_llvm_unary(
660 struct lp_build_tgsi_context *bld_base,
661 unsigned tgsi_opcode,
662 LLVMValueRef arg0);
663
664 LLVMValueRef
665 lp_build_emit_llvm_binary(
666 struct lp_build_tgsi_context *bld_base,
667 unsigned tgsi_opcode,
668 LLVMValueRef arg0,
669 LLVMValueRef arg1);
670
671 LLVMValueRef
672 lp_build_emit_llvm_ternary(
673 struct lp_build_tgsi_context *bld_base,
674 unsigned tgsi_opcode,
675 LLVMValueRef arg0,
676 LLVMValueRef arg1,
677 LLVMValueRef arg2);
678
679 boolean
680 lp_build_tgsi_inst_llvm(
681 struct lp_build_tgsi_context * bld_base,
682 const struct tgsi_full_instruction *inst);
683
684 LLVMValueRef
685 lp_build_emit_fetch_src(
686 struct lp_build_tgsi_context *bld_base,
687 const struct tgsi_full_src_register *reg,
688 enum tgsi_opcode_type stype,
689 const unsigned chan_index);
690
691 LLVMValueRef
692 lp_build_emit_fetch(
693 struct lp_build_tgsi_context *bld_base,
694 const struct tgsi_full_instruction *inst,
695 unsigned src_op,
696 const unsigned chan_index);
697
698
699 LLVMValueRef
700 lp_build_emit_fetch_texoffset(
701 struct lp_build_tgsi_context *bld_base,
702 const struct tgsi_full_instruction *inst,
703 unsigned tex_off_op,
704 const unsigned chan_index);
705
706 boolean
707 lp_build_tgsi_llvm(
708 struct lp_build_tgsi_context * bld_base,
709 const struct tgsi_token *tokens);
710
711 #ifdef __cplusplus
712 }
713 #endif
714
715 #endif /* LP_BLD_TGSI_H */