aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-05-19 11:48:23 +1000
committerMarge Bot <[email protected]>2020-07-02 04:12:16 +0000
commit6528a24cc525258cc3f368e1a7e3e59ec037ff0d (patch)
tree5ce93224dfedc28b7f0adaf3ae799473d8adfe6a /src/gallium/auxiliary
parentd55aa78615f0b80a5e35f28b32201189c86345b7 (diff)
draw: pass nr_samplers into llvm sample state creation.
This will be used later to handle indirect texture support. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c8
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.h3
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm_sample.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 2614654f192..483b631fe8e 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -2032,7 +2032,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
fake_buf_ptr = LLVMBuildGEP(builder, fake_buf, &bld.zero, 1, "");
/* code generated texture sampling */
- sampler = draw_llvm_sampler_soa_create(draw_llvm_variant_key_samplers(key));
+ sampler = draw_llvm_sampler_soa_create(draw_llvm_variant_key_samplers(key), key->nr_samplers);
image = draw_llvm_image_soa_create(draw_llvm_variant_key_images(key));
@@ -2821,7 +2821,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
draw_gs_jit_context_num_ssbos(variant->gallivm, context_ptr);
/* code generated texture sampling */
- sampler = draw_llvm_sampler_soa_create(variant->key.samplers);
+ sampler = draw_llvm_sampler_soa_create(variant->key.samplers, variant->key.nr_samplers);
image = draw_llvm_image_soa_create(draw_gs_llvm_variant_key_images(&variant->key));
mask_val = generate_mask_value(variant, gs_type);
lp_build_mask_begin(&mask, gallivm, gs_type, mask_val);
@@ -3429,7 +3429,7 @@ draw_tcs_llvm_generate(struct draw_llvm *llvm,
ssbos_ptr = draw_tcs_jit_context_ssbos(variant->gallivm, context_ptr);
num_ssbos_ptr =
draw_tcs_jit_context_num_ssbos(variant->gallivm, context_ptr);
- sampler = draw_llvm_sampler_soa_create(variant->key.samplers);
+ sampler = draw_llvm_sampler_soa_create(variant->key.samplers, variant->key.nr_samplers);
image = draw_llvm_image_soa_create(draw_tcs_llvm_variant_key_images(&variant->key));
LLVMValueRef counter = LLVMGetParam(variant_coro, 5);
@@ -3926,7 +3926,7 @@ draw_tes_llvm_generate(struct draw_llvm *llvm,
ssbos_ptr = draw_tes_jit_context_ssbos(variant->gallivm, context_ptr);
num_ssbos_ptr =
draw_tes_jit_context_num_ssbos(variant->gallivm, context_ptr);
- sampler = draw_llvm_sampler_soa_create(variant->key.samplers);
+ sampler = draw_llvm_sampler_soa_create(variant->key.samplers, variant->key.nr_samplers);
image = draw_llvm_image_soa_create(draw_tes_llvm_variant_key_images(&variant->key));
step = lp_build_const_int32(gallivm, vector_length);
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index d327e542afb..949b4c75622 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -890,7 +890,8 @@ void
draw_tes_llvm_dump_variant_key(struct draw_tes_llvm_variant_key *key);
struct lp_build_sampler_soa *
-draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_state);
+draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_state,
+ unsigned nr_samplers);
struct lp_build_image_soa *
draw_llvm_image_soa_create(const struct draw_image_static_state *static_state);
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c
index a30ebf5eabd..eee0c6319e5 100644
--- a/src/gallium/auxiliary/draw/draw_llvm_sample.c
+++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c
@@ -70,6 +70,8 @@ struct draw_llvm_sampler_soa
struct lp_build_sampler_soa base;
struct draw_llvm_sampler_dynamic_state dynamic_state;
+
+ unsigned nr_samplers;
};
struct draw_llvm_image_dynamic_state
@@ -342,7 +344,8 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
}
struct lp_build_sampler_soa *
-draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_state)
+draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_state,
+ unsigned nr_samplers)
{
struct draw_llvm_sampler_soa *sampler;
@@ -370,6 +373,7 @@ draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_stat
sampler->dynamic_state.base.border_color = draw_llvm_sampler_border_color;
sampler->dynamic_state.static_state = static_state;
+ sampler->nr_samplers = nr_samplers;
return &sampler->base;
}