aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-03-24 07:47:16 +1000
committerMarge Bot <[email protected]>2020-05-06 06:20:38 +0000
commit8d09d621373747235d90099adf5bed647090ec97 (patch)
treeefa6aac38b178dead86c4d9bc7fcba1828891391
parent3cc50cabf1459c6fd5db598de55ad02375aad880 (diff)
gallivm/sample: add num samples query for txqs (v2)
v2: add false to the existing users (Roland) Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_nir.c1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.h1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c6
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c1
4 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index 4944b0f944e..671b2800ebe 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -1472,6 +1472,7 @@ static void visit_txs(struct lp_build_nir_context *bld_base, nir_tex_instr *inst
params.explicit_lod = explicit_lod;
params.is_sviewinfo = TRUE;
params.sizes_out = sizes_out;
+ params.samples_only = false;
if (instr->op == nir_texop_query_levels)
params.explicit_lod = bld_base->uint_bld.zero;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
index ac47c9e5606..954bce600ec 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
@@ -123,6 +123,7 @@ struct lp_sampler_size_query_params
unsigned target;
LLVMValueRef context_ptr;
boolean is_sviewinfo;
+ bool samples_only;
enum lp_sampler_lod_property lod_property;
LLVMValueRef explicit_lod;
LLVMValueRef *sizes_out;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index ea51ed1f2d0..5b623eda26b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -3902,6 +3902,12 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
lp_build_context_init(&bld_int_vec4, gallivm, lp_type_int_vec(32, 128));
+ if (params->samples_only) {
+ params->sizes_out[0] = lp_build_broadcast(gallivm, lp_build_vec_type(gallivm, params->int_type),
+ dynamic_state->num_samples(dynamic_state, gallivm,
+ context_ptr, texture_unit));
+ return;
+ }
if (params->explicit_lod) {
/* FIXME: this needs to honor per-element lod */
lod = LLVMBuildExtractElement(gallivm->builder, params->explicit_lod,
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index efdce32d2d2..f61d05fded7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -2644,6 +2644,7 @@ emit_size_query( struct lp_build_tgsi_soa_context *bld,
params.lod_property = lod_property;
params.explicit_lod = explicit_lod;
params.sizes_out = sizes_out;
+ params.samples_only = false;
bld->sampler->emit_size_query(bld->sampler,
bld->bld_base.base.gallivm,