summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorDominik Drees <[email protected]>2019-04-15 11:05:46 +0200
committerRoland Scheidegger <[email protected]>2019-04-17 22:16:19 +0000
commit829f278ad0042b0bb5026b10e7393fa3e11498b2 (patch)
treebe70f2a88884faab0af3ec7c0bf6478929f75b11 /src/gallium/auxiliary/gallivm
parentad6dc13fc70a9802be41c1b9bb9e3487adb7ca7f (diff)
Add no_aos_sampling GALLIVM_PERF option
This forces using general sampling and should improve precision and performance in some cases.
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_debug.h9
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_init.c1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c5
3 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.h b/src/gallium/auxiliary/gallivm/lp_bld_debug.h
index eeef0d6ba61..406f628e158 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.h
@@ -43,10 +43,11 @@
#define GALLIVM_DEBUG_GC (1 << 4)
#define GALLIVM_DEBUG_DUMP_BC (1 << 5)
-#define GALLIVM_PERF_NO_BRILINEAR (1 << 0)
-#define GALLIVM_PERF_NO_RHO_APPROX (1 << 1)
-#define GALLIVM_PERF_NO_QUAD_LOD (1 << 2)
-#define GALLIVM_PERF_NO_OPT (1 << 3)
+#define GALLIVM_PERF_NO_BRILINEAR (1 << 0)
+#define GALLIVM_PERF_NO_RHO_APPROX (1 << 1)
+#define GALLIVM_PERF_NO_QUAD_LOD (1 << 2)
+#define GALLIVM_PERF_NO_OPT (1 << 3)
+#define GALLIVM_PERF_NO_AOS_SAMPLING (1 << 4)
#ifdef __cplusplus
extern "C" {
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index e8bca5bc3af..ee64bc9b953 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -65,6 +65,7 @@ static const struct debug_named_value lp_bld_perf_flags[] = {
{ "no_brilinear", GALLIVM_PERF_NO_BRILINEAR, "disable brilinear optimization" },
{ "no_rho_approx", GALLIVM_PERF_NO_RHO_APPROX, "disable rho_approx optimization" },
{ "no_quad_lod", GALLIVM_PERF_NO_QUAD_LOD, "disable quad_lod optimization" },
+ { "no_aos_sampling", GALLIVM_PERF_NO_AOS_SAMPLING, "disable aos sampling optimization" },
{ "nopt", GALLIVM_PERF_NO_OPT, "disable optimization passes to speed up shader compilation" },
{ "no_filter_hacks", GALLIVM_PERF_NO_BRILINEAR | GALLIVM_PERF_NO_RHO_APPROX |
GALLIVM_PERF_NO_QUAD_LOD, "disable filter optimization hacks" },
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index a6662c5e01b..5599ca99e74 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -3112,6 +3112,11 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
use_aos &= bld.num_lods <= num_quads ||
derived_sampler_state.min_img_filter ==
derived_sampler_state.mag_img_filter;
+
+ if(gallivm_perf & GALLIVM_PERF_NO_AOS_SAMPLING) {
+ use_aos = 0;
+ }
+
if (dims > 1) {
use_aos &= lp_is_simple_wrap_mode(derived_sampler_state.wrap_t);
if (dims > 2) {