gallivm/nir: refactor image operations for indirect support.
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_sample.h
1 /**************************************************************************
2 *
3 * Copyright 2009 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * 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, sub license, 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 portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 /**
29 * @file
30 * Texture sampling.
31 *
32 * @author Jose Fonseca <jfonseca@vmware.com>
33 */
34
35 #ifndef LP_BLD_SAMPLE_H
36 #define LP_BLD_SAMPLE_H
37
38
39 #include "pipe/p_format.h"
40 #include "util/u_debug.h"
41 #include "gallivm/lp_bld.h"
42 #include "gallivm/lp_bld_type.h"
43 #include "gallivm/lp_bld_swizzle.h"
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 struct pipe_resource;
50 struct pipe_sampler_view;
51 struct pipe_sampler_state;
52 struct pipe_image_view;
53 struct util_format_description;
54 struct lp_type;
55 struct lp_build_context;
56
57
58 /**
59 * Helper struct holding all derivatives needed for sampling
60 */
61 struct lp_derivatives
62 {
63 LLVMValueRef ddx[3];
64 LLVMValueRef ddy[3];
65 };
66
67
68 enum lp_sampler_lod_property {
69 LP_SAMPLER_LOD_SCALAR,
70 LP_SAMPLER_LOD_PER_ELEMENT,
71 LP_SAMPLER_LOD_PER_QUAD
72 };
73
74
75 enum lp_sampler_lod_control {
76 LP_SAMPLER_LOD_IMPLICIT,
77 LP_SAMPLER_LOD_BIAS,
78 LP_SAMPLER_LOD_EXPLICIT,
79 LP_SAMPLER_LOD_DERIVATIVES,
80 };
81
82
83 enum lp_sampler_op_type {
84 LP_SAMPLER_OP_TEXTURE,
85 LP_SAMPLER_OP_FETCH,
86 LP_SAMPLER_OP_GATHER,
87 LP_SAMPLER_OP_LODQ
88 };
89
90
91 #define LP_SAMPLER_SHADOW (1 << 0)
92 #define LP_SAMPLER_OFFSETS (1 << 1)
93 #define LP_SAMPLER_OP_TYPE_SHIFT 2
94 #define LP_SAMPLER_OP_TYPE_MASK (3 << 2)
95 #define LP_SAMPLER_LOD_CONTROL_SHIFT 4
96 #define LP_SAMPLER_LOD_CONTROL_MASK (3 << 4)
97 #define LP_SAMPLER_LOD_PROPERTY_SHIFT 6
98 #define LP_SAMPLER_LOD_PROPERTY_MASK (3 << 6)
99 #define LP_SAMPLER_GATHER_COMP_SHIFT 8
100 #define LP_SAMPLER_GATHER_COMP_MASK (3 << 8)
101 #define LP_SAMPLER_FETCH_MS (1 << 10)
102
103 struct lp_sampler_params
104 {
105 struct lp_type type;
106 unsigned texture_index;
107 unsigned sampler_index;
108 LLVMValueRef texture_index_offset;
109 unsigned sample_key;
110 LLVMValueRef context_ptr;
111 LLVMValueRef thread_data_ptr;
112 const LLVMValueRef *coords;
113 const LLVMValueRef *offsets;
114 LLVMValueRef ms_index;
115 LLVMValueRef lod;
116 const struct lp_derivatives *derivs;
117 LLVMValueRef *texel;
118 };
119
120 struct lp_sampler_size_query_params
121 {
122 struct lp_type int_type;
123 unsigned texture_unit;
124 LLVMValueRef texture_unit_offset;
125 unsigned target;
126 LLVMValueRef context_ptr;
127 boolean is_sviewinfo;
128 bool samples_only;
129 enum lp_sampler_lod_property lod_property;
130 LLVMValueRef explicit_lod;
131 LLVMValueRef *sizes_out;
132 };
133
134 #define LP_IMG_LOAD 0
135 #define LP_IMG_STORE 1
136 #define LP_IMG_ATOMIC 2
137 #define LP_IMG_ATOMIC_CAS 3
138
139 struct lp_img_params
140 {
141 struct lp_type type;
142 unsigned image_index;
143 LLVMValueRef image_index_offset;
144 unsigned img_op;
145 unsigned target;
146 LLVMAtomicRMWBinOp op;
147 LLVMValueRef exec_mask;
148 LLVMValueRef context_ptr;
149 LLVMValueRef thread_data_ptr;
150 const LLVMValueRef *coords;
151 LLVMValueRef ms_index;
152 LLVMValueRef indata[4];
153 LLVMValueRef indata2[4];
154 LLVMValueRef *outdata;
155 };
156 /**
157 * Texture static state.
158 *
159 * These are the bits of state from pipe_resource/pipe_sampler_view that
160 * are embedded in the generated code.
161 */
162 struct lp_static_texture_state
163 {
164 /* pipe_sampler_view's state */
165 enum pipe_format format;
166 unsigned swizzle_r:3; /**< PIPE_SWIZZLE_* */
167 unsigned swizzle_g:3;
168 unsigned swizzle_b:3;
169 unsigned swizzle_a:3;
170
171 /* pipe_texture's state */
172 unsigned target:4; /**< PIPE_TEXTURE_* */
173 unsigned pot_width:1; /**< is the width a power of two? */
174 unsigned pot_height:1;
175 unsigned pot_depth:1;
176 unsigned level_zero_only:1;
177 };
178
179
180 /**
181 * Sampler static state.
182 *
183 * These are the bits of state from pipe_sampler_state that
184 * are embedded in the generated code.
185 */
186 struct lp_static_sampler_state
187 {
188 /* pipe_sampler_state's state */
189 unsigned wrap_s:3;
190 unsigned wrap_t:3;
191 unsigned wrap_r:3;
192 unsigned min_img_filter:2;
193 unsigned min_mip_filter:2;
194 unsigned mag_img_filter:2;
195 unsigned compare_mode:1;
196 unsigned compare_func:3;
197 unsigned normalized_coords:1;
198 unsigned min_max_lod_equal:1; /**< min_lod == max_lod ? */
199 unsigned lod_bias_non_zero:1;
200 unsigned max_lod_pos:1;
201 unsigned apply_min_lod:1; /**< min_lod > 0 ? */
202 unsigned apply_max_lod:1; /**< max_lod < last_level ? */
203 unsigned seamless_cube_map:1;
204
205 /* Hacks */
206 unsigned force_nearest_s:1;
207 unsigned force_nearest_t:1;
208 };
209
210
211 /**
212 * Sampler dynamic state.
213 *
214 * These are the bits of state from pipe_resource/pipe_sampler_view
215 * as well as from sampler state that are computed at runtime.
216 *
217 * There are obtained through callbacks, as we don't want to tie the texture
218 * sampling code generation logic to any particular texture layout or pipe
219 * driver.
220 */
221 struct lp_sampler_dynamic_state
222 {
223 /* First callbacks for sampler view state */
224
225 /** Obtain the base texture width (or number of elements) (returns int32) */
226 LLVMValueRef
227 (*width)(const struct lp_sampler_dynamic_state *state,
228 struct gallivm_state *gallivm,
229 LLVMValueRef context_ptr,
230 unsigned texture_unit, LLVMValueRef texture_unit_offset);
231
232 /** Obtain the base texture height (returns int32) */
233 LLVMValueRef
234 (*height)(const struct lp_sampler_dynamic_state *state,
235 struct gallivm_state *gallivm,
236 LLVMValueRef context_ptr,
237 unsigned texture_unit, LLVMValueRef texture_unit_offset);
238
239 /** Obtain the base texture depth (or array size) (returns int32) */
240 LLVMValueRef
241 (*depth)(const struct lp_sampler_dynamic_state *state,
242 struct gallivm_state *gallivm,
243 LLVMValueRef context_ptr,
244 unsigned texture_unit, LLVMValueRef texture_unit_offset);
245
246 /** Obtain the first mipmap level (base level) (returns int32) */
247 LLVMValueRef
248 (*first_level)(const struct lp_sampler_dynamic_state *state,
249 struct gallivm_state *gallivm,
250 LLVMValueRef context_ptr,
251 unsigned texture_unit, LLVMValueRef texture_unit_offset);
252
253 /** Obtain the number of mipmap levels minus one (returns int32) */
254 LLVMValueRef
255 (*last_level)(const struct lp_sampler_dynamic_state *state,
256 struct gallivm_state *gallivm,
257 LLVMValueRef context_ptr,
258 unsigned texture_unit, LLVMValueRef texture_unit_offset);
259
260 /** Obtain stride in bytes between image rows/blocks (returns int32) */
261 LLVMValueRef
262 (*row_stride)(const struct lp_sampler_dynamic_state *state,
263 struct gallivm_state *gallivm,
264 LLVMValueRef context_ptr,
265 unsigned texture_unit, LLVMValueRef texture_unit_offset);
266
267 /** Obtain stride in bytes between image slices (returns int32) */
268 LLVMValueRef
269 (*img_stride)(const struct lp_sampler_dynamic_state *state,
270 struct gallivm_state *gallivm,
271 LLVMValueRef context_ptr,
272 unsigned texture_unit, LLVMValueRef texture_unit_offset);
273
274 /** Obtain pointer to base of texture */
275 LLVMValueRef
276 (*base_ptr)(const struct lp_sampler_dynamic_state *state,
277 struct gallivm_state *gallivm,
278 LLVMValueRef context_ptr,
279 unsigned texture_unit, LLVMValueRef texture_unit_offset);
280
281 /** Obtain pointer to array of mipmap offsets */
282 LLVMValueRef
283 (*mip_offsets)(const struct lp_sampler_dynamic_state *state,
284 struct gallivm_state *gallivm,
285 LLVMValueRef context_ptr,
286 unsigned texture_unit, LLVMValueRef texture_unit_offset);
287
288 /** Obtain number of samples (returns int32) */
289 LLVMValueRef
290 (*num_samples)(const struct lp_sampler_dynamic_state *state,
291 struct gallivm_state *gallivm,
292 LLVMValueRef context_ptr,
293 unsigned texture_unit, LLVMValueRef texture_unit_offset);
294
295 /** Obtain multisample stride (returns int32) */
296 LLVMValueRef
297 (*sample_stride)(const struct lp_sampler_dynamic_state *state,
298 struct gallivm_state *gallivm,
299 LLVMValueRef context_ptr,
300 unsigned texture_unit, LLVMValueRef texture_unit_offset);
301
302 /* These are callbacks for sampler state */
303
304 /** Obtain texture min lod (returns float) */
305 LLVMValueRef
306 (*min_lod)(const struct lp_sampler_dynamic_state *state,
307 struct gallivm_state *gallivm,
308 LLVMValueRef context_ptr,
309 unsigned sampler_unit);
310
311 /** Obtain texture max lod (returns float) */
312 LLVMValueRef
313 (*max_lod)(const struct lp_sampler_dynamic_state *state,
314 struct gallivm_state *gallivm,
315 LLVMValueRef context_ptr,
316 unsigned sampler_unit);
317
318 /** Obtain texture lod bias (returns float) */
319 LLVMValueRef
320 (*lod_bias)(const struct lp_sampler_dynamic_state *state,
321 struct gallivm_state *gallivm,
322 LLVMValueRef context_ptr,
323 unsigned sampler_unit);
324
325 /** Obtain texture border color (returns ptr to float[4]) */
326 LLVMValueRef
327 (*border_color)(const struct lp_sampler_dynamic_state *state,
328 struct gallivm_state *gallivm,
329 LLVMValueRef context_ptr,
330 unsigned sampler_unit);
331
332 /**
333 * Obtain texture cache (returns ptr to lp_build_format_cache).
334 *
335 * It's optional: no caching will be done if it's NULL.
336 */
337 LLVMValueRef
338 (*cache_ptr)(const struct lp_sampler_dynamic_state *state,
339 struct gallivm_state *gallivm,
340 LLVMValueRef thread_data_ptr,
341 unsigned unit);
342 };
343
344
345 /**
346 * Keep all information for sampling code generation in a single place.
347 */
348 struct lp_build_sample_context
349 {
350 struct gallivm_state *gallivm;
351
352 const struct lp_static_texture_state *static_texture_state;
353 const struct lp_static_sampler_state *static_sampler_state;
354
355 struct lp_sampler_dynamic_state *dynamic_state;
356
357 const struct util_format_description *format_desc;
358
359 /* See texture_dims() */
360 unsigned dims;
361
362 /** SIMD vector width */
363 unsigned vector_width;
364
365 /** number of mipmaps (valid are 1, length/4, length) */
366 unsigned num_mips;
367
368 /** number of lod values (valid are 1, length/4, length) */
369 unsigned num_lods;
370
371 unsigned gather_comp;
372 boolean no_quad_lod;
373 boolean no_brilinear;
374 boolean no_rho_approx;
375 boolean fetch_ms;
376
377 /** regular scalar float type */
378 struct lp_type float_type;
379 struct lp_build_context float_bld;
380
381 /** float vector type */
382 struct lp_build_context float_vec_bld;
383
384 /** regular scalar int type */
385 struct lp_type int_type;
386 struct lp_build_context int_bld;
387
388 /** Incoming coordinates type and build context */
389 struct lp_type coord_type;
390 struct lp_build_context coord_bld;
391
392 /** Signed integer coordinates */
393 struct lp_type int_coord_type;
394 struct lp_build_context int_coord_bld;
395
396 /** Unsigned integer texture size */
397 struct lp_type int_size_in_type;
398 struct lp_build_context int_size_in_bld;
399
400 /** Float incoming texture size */
401 struct lp_type float_size_in_type;
402 struct lp_build_context float_size_in_bld;
403
404 /** Unsigned integer texture size (might be per quad) */
405 struct lp_type int_size_type;
406 struct lp_build_context int_size_bld;
407
408 /** Float texture size (might be per quad) */
409 struct lp_type float_size_type;
410 struct lp_build_context float_size_bld;
411
412 /** Output texels type and build context */
413 struct lp_type texel_type;
414 struct lp_build_context texel_bld;
415
416 /** Float level type */
417 struct lp_type levelf_type;
418 struct lp_build_context levelf_bld;
419
420 /** Int level type */
421 struct lp_type leveli_type;
422 struct lp_build_context leveli_bld;
423
424 /** Float lod type */
425 struct lp_type lodf_type;
426 struct lp_build_context lodf_bld;
427
428 /** Int lod type */
429 struct lp_type lodi_type;
430 struct lp_build_context lodi_bld;
431
432 /* Common dynamic state values */
433 LLVMValueRef row_stride_array;
434 LLVMValueRef img_stride_array;
435 LLVMValueRef base_ptr;
436 LLVMValueRef mip_offsets;
437 LLVMValueRef cache;
438 LLVMValueRef sample_stride;
439
440 /** Integer vector with texture width, height, depth */
441 LLVMValueRef int_size;
442
443 LLVMValueRef border_color_clamped;
444
445 LLVMValueRef context_ptr;
446 };
447
448 /*
449 * Indirect texture access context
450 *
451 * This is used to store info across building
452 * and indirect texture switch statement.
453 */
454 struct lp_build_sample_array_switch {
455 struct gallivm_state *gallivm;
456 struct lp_sampler_params params;
457 unsigned base, range;
458 LLVMValueRef switch_ref;
459 LLVMBasicBlockRef merge_ref;
460 LLVMValueRef phi;
461 };
462
463
464 /**
465 * We only support a few wrap modes in lp_build_sample_wrap_linear_int() at
466 * this time. Return whether the given mode is supported by that function.
467 */
468 static inline boolean
469 lp_is_simple_wrap_mode(unsigned mode)
470 {
471 switch (mode) {
472 case PIPE_TEX_WRAP_REPEAT:
473 case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
474 return TRUE;
475 default:
476 return FALSE;
477 }
478 }
479
480
481 static inline void
482 apply_sampler_swizzle(struct lp_build_sample_context *bld,
483 LLVMValueRef *texel)
484 {
485 unsigned char swizzles[4];
486
487 swizzles[0] = bld->static_texture_state->swizzle_r;
488 swizzles[1] = bld->static_texture_state->swizzle_g;
489 swizzles[2] = bld->static_texture_state->swizzle_b;
490 swizzles[3] = bld->static_texture_state->swizzle_a;
491
492 lp_build_swizzle_soa_inplace(&bld->texel_bld, texel, swizzles);
493 }
494
495 /*
496 * not really dimension as such, this indicates the amount of
497 * "normal" texture coords subject to minification, wrapping etc.
498 */
499 static inline unsigned
500 texture_dims(enum pipe_texture_target tex)
501 {
502 switch (tex) {
503 case PIPE_TEXTURE_1D:
504 case PIPE_TEXTURE_1D_ARRAY:
505 case PIPE_BUFFER:
506 return 1;
507 case PIPE_TEXTURE_2D:
508 case PIPE_TEXTURE_2D_ARRAY:
509 case PIPE_TEXTURE_RECT:
510 case PIPE_TEXTURE_CUBE:
511 case PIPE_TEXTURE_CUBE_ARRAY:
512 return 2;
513 case PIPE_TEXTURE_3D:
514 return 3;
515 default:
516 assert(0 && "bad texture target in texture_dims()");
517 return 2;
518 }
519 }
520
521 static inline boolean
522 has_layer_coord(enum pipe_texture_target tex)
523 {
524 switch (tex) {
525 case PIPE_TEXTURE_1D_ARRAY:
526 case PIPE_TEXTURE_2D_ARRAY:
527 /* cube is not layered but 3rd coord (after cube mapping) behaves the same */
528 case PIPE_TEXTURE_CUBE:
529 case PIPE_TEXTURE_CUBE_ARRAY:
530 return TRUE;
531 default:
532 return FALSE;
533 }
534 }
535
536
537 boolean
538 lp_sampler_wrap_mode_uses_border_color(unsigned mode,
539 unsigned min_img_filter,
540 unsigned mag_img_filter);
541
542 /**
543 * Derive the sampler static state.
544 */
545 void
546 lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
547 const struct pipe_sampler_state *sampler);
548
549
550 void
551 lp_sampler_static_texture_state(struct lp_static_texture_state *state,
552 const struct pipe_sampler_view *view);
553
554 void
555 lp_sampler_static_texture_state_image(struct lp_static_texture_state *state,
556 const struct pipe_image_view *view);
557
558 void
559 lp_build_lod_selector(struct lp_build_sample_context *bld,
560 boolean is_lodq,
561 unsigned texture_index,
562 unsigned sampler_index,
563 LLVMValueRef s,
564 LLVMValueRef t,
565 LLVMValueRef r,
566 LLVMValueRef cube_rho,
567 const struct lp_derivatives *derivs,
568 LLVMValueRef lod_bias, /* optional */
569 LLVMValueRef explicit_lod, /* optional */
570 unsigned mip_filter,
571 LLVMValueRef *out_lod,
572 LLVMValueRef *out_lod_ipart,
573 LLVMValueRef *out_lod_fpart,
574 LLVMValueRef *out_lod_positive);
575
576 void
577 lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
578 unsigned texture_unit,
579 LLVMValueRef lod,
580 LLVMValueRef *level_out,
581 LLVMValueRef *out_of_bounds);
582
583 void
584 lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
585 unsigned texture_unit,
586 LLVMValueRef lod_ipart,
587 LLVMValueRef *lod_fpart_inout,
588 LLVMValueRef *level0_out,
589 LLVMValueRef *level1_out);
590
591 LLVMValueRef
592 lp_build_get_mipmap_level(struct lp_build_sample_context *bld,
593 LLVMValueRef level);
594
595
596 LLVMValueRef
597 lp_build_get_mip_offsets(struct lp_build_sample_context *bld,
598 LLVMValueRef level);
599
600
601 void
602 lp_build_mipmap_level_sizes(struct lp_build_sample_context *bld,
603 LLVMValueRef ilevel,
604 LLVMValueRef *out_size_vec,
605 LLVMValueRef *row_stride_vec,
606 LLVMValueRef *img_stride_vec);
607
608
609 void
610 lp_build_extract_image_sizes(struct lp_build_sample_context *bld,
611 struct lp_build_context *size_bld,
612 struct lp_type coord_type,
613 LLVMValueRef size,
614 LLVMValueRef *out_width,
615 LLVMValueRef *out_height,
616 LLVMValueRef *out_depth);
617
618
619 void
620 lp_build_unnormalized_coords(struct lp_build_sample_context *bld,
621 LLVMValueRef flt_size,
622 LLVMValueRef *s,
623 LLVMValueRef *t,
624 LLVMValueRef *r);
625
626
627 void
628 lp_build_cube_lookup(struct lp_build_sample_context *bld,
629 LLVMValueRef *coords,
630 const struct lp_derivatives *derivs_in, /* optional */
631 LLVMValueRef *rho,
632 struct lp_derivatives *derivs_out, /* optional */
633 boolean need_derivs);
634
635
636 void
637 lp_build_cube_new_coords(struct lp_build_context *ivec_bld,
638 LLVMValueRef face,
639 LLVMValueRef x0,
640 LLVMValueRef x1,
641 LLVMValueRef y0,
642 LLVMValueRef y1,
643 LLVMValueRef max_coord,
644 LLVMValueRef new_faces[4],
645 LLVMValueRef new_xcoords[4][2],
646 LLVMValueRef new_ycoords[4][2]);
647
648
649 void
650 lp_build_sample_partial_offset(struct lp_build_context *bld,
651 unsigned block_length,
652 LLVMValueRef coord,
653 LLVMValueRef stride,
654 LLVMValueRef *out_offset,
655 LLVMValueRef *out_i);
656
657
658 void
659 lp_build_sample_offset(struct lp_build_context *bld,
660 const struct util_format_description *format_desc,
661 LLVMValueRef x,
662 LLVMValueRef y,
663 LLVMValueRef z,
664 LLVMValueRef y_stride,
665 LLVMValueRef z_stride,
666 LLVMValueRef *out_offset,
667 LLVMValueRef *out_i,
668 LLVMValueRef *out_j);
669
670
671 void
672 lp_build_sample_soa(const struct lp_static_texture_state *static_texture_state,
673 const struct lp_static_sampler_state *static_sampler_state,
674 struct lp_sampler_dynamic_state *dynamic_texture_state,
675 struct gallivm_state *gallivm,
676 const struct lp_sampler_params *params);
677
678
679 void
680 lp_build_coord_repeat_npot_linear(struct lp_build_sample_context *bld,
681 LLVMValueRef coord_f,
682 LLVMValueRef length_i,
683 LLVMValueRef length_f,
684 LLVMValueRef *coord0_i,
685 LLVMValueRef *weight_f);
686
687
688 void
689 lp_build_size_query_soa(struct gallivm_state *gallivm,
690 const struct lp_static_texture_state *static_state,
691 struct lp_sampler_dynamic_state *dynamic_state,
692 const struct lp_sampler_size_query_params *params);
693
694 void
695 lp_build_sample_nop(struct gallivm_state *gallivm,
696 struct lp_type type,
697 const LLVMValueRef *coords,
698 LLVMValueRef texel_out[4]);
699
700
701 LLVMValueRef
702 lp_build_minify(struct lp_build_context *bld,
703 LLVMValueRef base_size,
704 LLVMValueRef level,
705 boolean lod_scalar);
706
707 void
708 lp_build_img_op_soa(const struct lp_static_texture_state *static_texture_state,
709 struct lp_sampler_dynamic_state *dynamic_state,
710 struct gallivm_state *gallivm,
711 const struct lp_img_params *params,
712 LLVMValueRef outdata[4]);
713
714 void
715 lp_build_sample_array_init_soa(struct lp_build_sample_array_switch *switch_info,
716 struct gallivm_state *gallivm,
717 const struct lp_sampler_params *params,
718 LLVMValueRef idx,
719 unsigned base, unsigned range);
720
721 void
722 lp_build_sample_array_case_soa(struct lp_build_sample_array_switch *switch_info,
723 int idx,
724 const struct lp_static_texture_state *static_texture_state,
725 const struct lp_static_sampler_state *static_sampler_state,
726 struct lp_sampler_dynamic_state *dynamic_texture_state);
727
728 void lp_build_sample_array_fini_soa(struct lp_build_sample_array_switch *switch_info);
729 #ifdef __cplusplus
730 }
731 #endif
732
733 #endif /* LP_BLD_SAMPLE_H */