24fc06ffe722c24ec832bd1f78962f7bb9c95e7a
[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 unsigned img_op;
144 unsigned target;
145 LLVMAtomicRMWBinOp op;
146 LLVMValueRef exec_mask;
147 LLVMValueRef context_ptr;
148 LLVMValueRef thread_data_ptr;
149 const LLVMValueRef *coords;
150 LLVMValueRef ms_index;
151 LLVMValueRef indata[4];
152 LLVMValueRef indata2[4];
153 LLVMValueRef *outdata;
154 };
155 /**
156 * Texture static state.
157 *
158 * These are the bits of state from pipe_resource/pipe_sampler_view that
159 * are embedded in the generated code.
160 */
161 struct lp_static_texture_state
162 {
163 /* pipe_sampler_view's state */
164 enum pipe_format format;
165 unsigned swizzle_r:3; /**< PIPE_SWIZZLE_* */
166 unsigned swizzle_g:3;
167 unsigned swizzle_b:3;
168 unsigned swizzle_a:3;
169
170 /* pipe_texture's state */
171 unsigned target:4; /**< PIPE_TEXTURE_* */
172 unsigned pot_width:1; /**< is the width a power of two? */
173 unsigned pot_height:1;
174 unsigned pot_depth:1;
175 unsigned level_zero_only:1;
176 };
177
178
179 /**
180 * Sampler static state.
181 *
182 * These are the bits of state from pipe_sampler_state that
183 * are embedded in the generated code.
184 */
185 struct lp_static_sampler_state
186 {
187 /* pipe_sampler_state's state */
188 unsigned wrap_s:3;
189 unsigned wrap_t:3;
190 unsigned wrap_r:3;
191 unsigned min_img_filter:2;
192 unsigned min_mip_filter:2;
193 unsigned mag_img_filter:2;
194 unsigned compare_mode:1;
195 unsigned compare_func:3;
196 unsigned normalized_coords:1;
197 unsigned min_max_lod_equal:1; /**< min_lod == max_lod ? */
198 unsigned lod_bias_non_zero:1;
199 unsigned max_lod_pos:1;
200 unsigned apply_min_lod:1; /**< min_lod > 0 ? */
201 unsigned apply_max_lod:1; /**< max_lod < last_level ? */
202 unsigned seamless_cube_map:1;
203
204 /* Hacks */
205 unsigned force_nearest_s:1;
206 unsigned force_nearest_t:1;
207 };
208
209
210 /**
211 * Sampler dynamic state.
212 *
213 * These are the bits of state from pipe_resource/pipe_sampler_view
214 * as well as from sampler state that are computed at runtime.
215 *
216 * There are obtained through callbacks, as we don't want to tie the texture
217 * sampling code generation logic to any particular texture layout or pipe
218 * driver.
219 */
220 struct lp_sampler_dynamic_state
221 {
222 /* First callbacks for sampler view state */
223
224 /** Obtain the base texture width (or number of elements) (returns int32) */
225 LLVMValueRef
226 (*width)(const struct lp_sampler_dynamic_state *state,
227 struct gallivm_state *gallivm,
228 LLVMValueRef context_ptr,
229 unsigned texture_unit);
230
231 /** Obtain the base texture height (returns int32) */
232 LLVMValueRef
233 (*height)(const struct lp_sampler_dynamic_state *state,
234 struct gallivm_state *gallivm,
235 LLVMValueRef context_ptr,
236 unsigned texture_unit);
237
238 /** Obtain the base texture depth (or array size) (returns int32) */
239 LLVMValueRef
240 (*depth)(const struct lp_sampler_dynamic_state *state,
241 struct gallivm_state *gallivm,
242 LLVMValueRef context_ptr,
243 unsigned texture_unit);
244
245 /** Obtain the first mipmap level (base level) (returns int32) */
246 LLVMValueRef
247 (*first_level)(const struct lp_sampler_dynamic_state *state,
248 struct gallivm_state *gallivm,
249 LLVMValueRef context_ptr,
250 unsigned texture_unit);
251
252 /** Obtain the number of mipmap levels minus one (returns int32) */
253 LLVMValueRef
254 (*last_level)(const struct lp_sampler_dynamic_state *state,
255 struct gallivm_state *gallivm,
256 LLVMValueRef context_ptr,
257 unsigned texture_unit);
258
259 /** Obtain stride in bytes between image rows/blocks (returns int32) */
260 LLVMValueRef
261 (*row_stride)(const struct lp_sampler_dynamic_state *state,
262 struct gallivm_state *gallivm,
263 LLVMValueRef context_ptr,
264 unsigned texture_unit);
265
266 /** Obtain stride in bytes between image slices (returns int32) */
267 LLVMValueRef
268 (*img_stride)(const struct lp_sampler_dynamic_state *state,
269 struct gallivm_state *gallivm,
270 LLVMValueRef context_ptr,
271 unsigned texture_unit);
272
273 /** Obtain pointer to base of texture */
274 LLVMValueRef
275 (*base_ptr)(const struct lp_sampler_dynamic_state *state,
276 struct gallivm_state *gallivm,
277 LLVMValueRef context_ptr,
278 unsigned texture_unit);
279
280 /** Obtain pointer to array of mipmap offsets */
281 LLVMValueRef
282 (*mip_offsets)(const struct lp_sampler_dynamic_state *state,
283 struct gallivm_state *gallivm,
284 LLVMValueRef context_ptr,
285 unsigned texture_unit);
286
287 /** Obtain number of samples (returns int32) */
288 LLVMValueRef
289 (*num_samples)(const struct lp_sampler_dynamic_state *state,
290 struct gallivm_state *gallivm,
291 LLVMValueRef context_ptr,
292 unsigned texture_unit);
293
294 /** Obtain multisample stride (returns int32) */
295 LLVMValueRef
296 (*sample_stride)(const struct lp_sampler_dynamic_state *state,
297 struct gallivm_state *gallivm,
298 LLVMValueRef context_ptr,
299 unsigned texture_unit);
300
301 /* These are callbacks for sampler state */
302
303 /** Obtain texture min lod (returns float) */
304 LLVMValueRef
305 (*min_lod)(const struct lp_sampler_dynamic_state *state,
306 struct gallivm_state *gallivm,
307 LLVMValueRef context_ptr,
308 unsigned sampler_unit);
309
310 /** Obtain texture max lod (returns float) */
311 LLVMValueRef
312 (*max_lod)(const struct lp_sampler_dynamic_state *state,
313 struct gallivm_state *gallivm,
314 LLVMValueRef context_ptr,
315 unsigned sampler_unit);
316
317 /** Obtain texture lod bias (returns float) */
318 LLVMValueRef
319 (*lod_bias)(const struct lp_sampler_dynamic_state *state,
320 struct gallivm_state *gallivm,
321 LLVMValueRef context_ptr,
322 unsigned sampler_unit);
323
324 /** Obtain texture border color (returns ptr to float[4]) */
325 LLVMValueRef
326 (*border_color)(const struct lp_sampler_dynamic_state *state,
327 struct gallivm_state *gallivm,
328 LLVMValueRef context_ptr,
329 unsigned sampler_unit);
330
331 /**
332 * Obtain texture cache (returns ptr to lp_build_format_cache).
333 *
334 * It's optional: no caching will be done if it's NULL.
335 */
336 LLVMValueRef
337 (*cache_ptr)(const struct lp_sampler_dynamic_state *state,
338 struct gallivm_state *gallivm,
339 LLVMValueRef thread_data_ptr,
340 unsigned unit);
341 };
342
343
344 /**
345 * Keep all information for sampling code generation in a single place.
346 */
347 struct lp_build_sample_context
348 {
349 struct gallivm_state *gallivm;
350
351 const struct lp_static_texture_state *static_texture_state;
352 const struct lp_static_sampler_state *static_sampler_state;
353
354 struct lp_sampler_dynamic_state *dynamic_state;
355
356 const struct util_format_description *format_desc;
357
358 /* See texture_dims() */
359 unsigned dims;
360
361 /** SIMD vector width */
362 unsigned vector_width;
363
364 /** number of mipmaps (valid are 1, length/4, length) */
365 unsigned num_mips;
366
367 /** number of lod values (valid are 1, length/4, length) */
368 unsigned num_lods;
369
370 unsigned gather_comp;
371 boolean no_quad_lod;
372 boolean no_brilinear;
373 boolean no_rho_approx;
374 boolean fetch_ms;
375
376 /** regular scalar float type */
377 struct lp_type float_type;
378 struct lp_build_context float_bld;
379
380 /** float vector type */
381 struct lp_build_context float_vec_bld;
382
383 /** regular scalar int type */
384 struct lp_type int_type;
385 struct lp_build_context int_bld;
386
387 /** Incoming coordinates type and build context */
388 struct lp_type coord_type;
389 struct lp_build_context coord_bld;
390
391 /** Signed integer coordinates */
392 struct lp_type int_coord_type;
393 struct lp_build_context int_coord_bld;
394
395 /** Unsigned integer texture size */
396 struct lp_type int_size_in_type;
397 struct lp_build_context int_size_in_bld;
398
399 /** Float incoming texture size */
400 struct lp_type float_size_in_type;
401 struct lp_build_context float_size_in_bld;
402
403 /** Unsigned integer texture size (might be per quad) */
404 struct lp_type int_size_type;
405 struct lp_build_context int_size_bld;
406
407 /** Float texture size (might be per quad) */
408 struct lp_type float_size_type;
409 struct lp_build_context float_size_bld;
410
411 /** Output texels type and build context */
412 struct lp_type texel_type;
413 struct lp_build_context texel_bld;
414
415 /** Float level type */
416 struct lp_type levelf_type;
417 struct lp_build_context levelf_bld;
418
419 /** Int level type */
420 struct lp_type leveli_type;
421 struct lp_build_context leveli_bld;
422
423 /** Float lod type */
424 struct lp_type lodf_type;
425 struct lp_build_context lodf_bld;
426
427 /** Int lod type */
428 struct lp_type lodi_type;
429 struct lp_build_context lodi_bld;
430
431 /* Common dynamic state values */
432 LLVMValueRef row_stride_array;
433 LLVMValueRef img_stride_array;
434 LLVMValueRef base_ptr;
435 LLVMValueRef mip_offsets;
436 LLVMValueRef cache;
437 LLVMValueRef sample_stride;
438
439 /** Integer vector with texture width, height, depth */
440 LLVMValueRef int_size;
441
442 LLVMValueRef border_color_clamped;
443
444 LLVMValueRef context_ptr;
445 };
446
447 /*
448 * Indirect texture access context
449 *
450 * This is used to store info across building
451 * and indirect texture switch statement.
452 */
453 struct lp_build_sample_array_switch {
454 struct gallivm_state *gallivm;
455 struct lp_sampler_params params;
456 unsigned base, range;
457 LLVMValueRef switch_ref;
458 LLVMBasicBlockRef merge_ref;
459 LLVMValueRef phi;
460 };
461
462
463 /**
464 * We only support a few wrap modes in lp_build_sample_wrap_linear_int() at
465 * this time. Return whether the given mode is supported by that function.
466 */
467 static inline boolean
468 lp_is_simple_wrap_mode(unsigned mode)
469 {
470 switch (mode) {
471 case PIPE_TEX_WRAP_REPEAT:
472 case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
473 return TRUE;
474 default:
475 return FALSE;
476 }
477 }
478
479
480 static inline void
481 apply_sampler_swizzle(struct lp_build_sample_context *bld,
482 LLVMValueRef *texel)
483 {
484 unsigned char swizzles[4];
485
486 swizzles[0] = bld->static_texture_state->swizzle_r;
487 swizzles[1] = bld->static_texture_state->swizzle_g;
488 swizzles[2] = bld->static_texture_state->swizzle_b;
489 swizzles[3] = bld->static_texture_state->swizzle_a;
490
491 lp_build_swizzle_soa_inplace(&bld->texel_bld, texel, swizzles);
492 }
493
494 /*
495 * not really dimension as such, this indicates the amount of
496 * "normal" texture coords subject to minification, wrapping etc.
497 */
498 static inline unsigned
499 texture_dims(enum pipe_texture_target tex)
500 {
501 switch (tex) {
502 case PIPE_TEXTURE_1D:
503 case PIPE_TEXTURE_1D_ARRAY:
504 case PIPE_BUFFER:
505 return 1;
506 case PIPE_TEXTURE_2D:
507 case PIPE_TEXTURE_2D_ARRAY:
508 case PIPE_TEXTURE_RECT:
509 case PIPE_TEXTURE_CUBE:
510 case PIPE_TEXTURE_CUBE_ARRAY:
511 return 2;
512 case PIPE_TEXTURE_3D:
513 return 3;
514 default:
515 assert(0 && "bad texture target in texture_dims()");
516 return 2;
517 }
518 }
519
520 static inline boolean
521 has_layer_coord(enum pipe_texture_target tex)
522 {
523 switch (tex) {
524 case PIPE_TEXTURE_1D_ARRAY:
525 case PIPE_TEXTURE_2D_ARRAY:
526 /* cube is not layered but 3rd coord (after cube mapping) behaves the same */
527 case PIPE_TEXTURE_CUBE:
528 case PIPE_TEXTURE_CUBE_ARRAY:
529 return TRUE;
530 default:
531 return FALSE;
532 }
533 }
534
535
536 boolean
537 lp_sampler_wrap_mode_uses_border_color(unsigned mode,
538 unsigned min_img_filter,
539 unsigned mag_img_filter);
540
541 /**
542 * Derive the sampler static state.
543 */
544 void
545 lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
546 const struct pipe_sampler_state *sampler);
547
548
549 void
550 lp_sampler_static_texture_state(struct lp_static_texture_state *state,
551 const struct pipe_sampler_view *view);
552
553 void
554 lp_sampler_static_texture_state_image(struct lp_static_texture_state *state,
555 const struct pipe_image_view *view);
556
557 void
558 lp_build_lod_selector(struct lp_build_sample_context *bld,
559 boolean is_lodq,
560 unsigned texture_index,
561 unsigned sampler_index,
562 LLVMValueRef s,
563 LLVMValueRef t,
564 LLVMValueRef r,
565 LLVMValueRef cube_rho,
566 const struct lp_derivatives *derivs,
567 LLVMValueRef lod_bias, /* optional */
568 LLVMValueRef explicit_lod, /* optional */
569 unsigned mip_filter,
570 LLVMValueRef *out_lod,
571 LLVMValueRef *out_lod_ipart,
572 LLVMValueRef *out_lod_fpart,
573 LLVMValueRef *out_lod_positive);
574
575 void
576 lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
577 unsigned texture_unit,
578 LLVMValueRef lod,
579 LLVMValueRef *level_out,
580 LLVMValueRef *out_of_bounds);
581
582 void
583 lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
584 unsigned texture_unit,
585 LLVMValueRef lod_ipart,
586 LLVMValueRef *lod_fpart_inout,
587 LLVMValueRef *level0_out,
588 LLVMValueRef *level1_out);
589
590 LLVMValueRef
591 lp_build_get_mipmap_level(struct lp_build_sample_context *bld,
592 LLVMValueRef level);
593
594
595 LLVMValueRef
596 lp_build_get_mip_offsets(struct lp_build_sample_context *bld,
597 LLVMValueRef level);
598
599
600 void
601 lp_build_mipmap_level_sizes(struct lp_build_sample_context *bld,
602 LLVMValueRef ilevel,
603 LLVMValueRef *out_size_vec,
604 LLVMValueRef *row_stride_vec,
605 LLVMValueRef *img_stride_vec);
606
607
608 void
609 lp_build_extract_image_sizes(struct lp_build_sample_context *bld,
610 struct lp_build_context *size_bld,
611 struct lp_type coord_type,
612 LLVMValueRef size,
613 LLVMValueRef *out_width,
614 LLVMValueRef *out_height,
615 LLVMValueRef *out_depth);
616
617
618 void
619 lp_build_unnormalized_coords(struct lp_build_sample_context *bld,
620 LLVMValueRef flt_size,
621 LLVMValueRef *s,
622 LLVMValueRef *t,
623 LLVMValueRef *r);
624
625
626 void
627 lp_build_cube_lookup(struct lp_build_sample_context *bld,
628 LLVMValueRef *coords,
629 const struct lp_derivatives *derivs_in, /* optional */
630 LLVMValueRef *rho,
631 struct lp_derivatives *derivs_out, /* optional */
632 boolean need_derivs);
633
634
635 void
636 lp_build_cube_new_coords(struct lp_build_context *ivec_bld,
637 LLVMValueRef face,
638 LLVMValueRef x0,
639 LLVMValueRef x1,
640 LLVMValueRef y0,
641 LLVMValueRef y1,
642 LLVMValueRef max_coord,
643 LLVMValueRef new_faces[4],
644 LLVMValueRef new_xcoords[4][2],
645 LLVMValueRef new_ycoords[4][2]);
646
647
648 void
649 lp_build_sample_partial_offset(struct lp_build_context *bld,
650 unsigned block_length,
651 LLVMValueRef coord,
652 LLVMValueRef stride,
653 LLVMValueRef *out_offset,
654 LLVMValueRef *out_i);
655
656
657 void
658 lp_build_sample_offset(struct lp_build_context *bld,
659 const struct util_format_description *format_desc,
660 LLVMValueRef x,
661 LLVMValueRef y,
662 LLVMValueRef z,
663 LLVMValueRef y_stride,
664 LLVMValueRef z_stride,
665 LLVMValueRef *out_offset,
666 LLVMValueRef *out_i,
667 LLVMValueRef *out_j);
668
669
670 void
671 lp_build_sample_soa(const struct lp_static_texture_state *static_texture_state,
672 const struct lp_static_sampler_state *static_sampler_state,
673 struct lp_sampler_dynamic_state *dynamic_texture_state,
674 struct gallivm_state *gallivm,
675 const struct lp_sampler_params *params);
676
677
678 void
679 lp_build_coord_repeat_npot_linear(struct lp_build_sample_context *bld,
680 LLVMValueRef coord_f,
681 LLVMValueRef length_i,
682 LLVMValueRef length_f,
683 LLVMValueRef *coord0_i,
684 LLVMValueRef *weight_f);
685
686
687 void
688 lp_build_size_query_soa(struct gallivm_state *gallivm,
689 const struct lp_static_texture_state *static_state,
690 struct lp_sampler_dynamic_state *dynamic_state,
691 const struct lp_sampler_size_query_params *params);
692
693 void
694 lp_build_sample_nop(struct gallivm_state *gallivm,
695 struct lp_type type,
696 const LLVMValueRef *coords,
697 LLVMValueRef texel_out[4]);
698
699
700 LLVMValueRef
701 lp_build_minify(struct lp_build_context *bld,
702 LLVMValueRef base_size,
703 LLVMValueRef level,
704 boolean lod_scalar);
705
706 void
707 lp_build_img_op_soa(const struct lp_static_texture_state *static_texture_state,
708 struct lp_sampler_dynamic_state *dynamic_state,
709 struct gallivm_state *gallivm,
710 const struct lp_img_params *params);
711
712 void
713 lp_build_sample_array_init_soa(struct lp_build_sample_array_switch *switch_info,
714 struct gallivm_state *gallivm,
715 const struct lp_sampler_params *params,
716 LLVMValueRef idx,
717 unsigned base, unsigned range);
718
719 void
720 lp_build_sample_array_case_soa(struct lp_build_sample_array_switch *switch_info,
721 int idx,
722 const struct lp_static_texture_state *static_texture_state,
723 const struct lp_static_sampler_state *static_sampler_state,
724 struct lp_sampler_dynamic_state *dynamic_texture_state);
725
726 void lp_build_sample_array_fini_soa(struct lp_build_sample_array_switch *switch_info);
727 #ifdef __cplusplus
728 }
729 #endif
730
731 #endif /* LP_BLD_SAMPLE_H */