From 34423391e02a148518a4e9f640d61c609957282d Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 2 Aug 2021 14:34:02 +0200 Subject: [PATCH] gallivm: make rho-approximation opt-in instead of opt-out The RHO approximation code has issues passing the OpenGL ES 3.0 CTS, so let's make correctness the default instead. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_debug.h | 2 +- src/gallium/auxiliary/gallivm/lp_bld_init.c | 5 ++--- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.h b/src/gallium/auxiliary/gallivm/lp_bld_debug.h index 5ebb590f9cb..a5dd7b80dcc 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.h @@ -44,7 +44,7 @@ #define GALLIVM_DEBUG_DUMP_BC (1 << 5) #define GALLIVM_PERF_BRILINEAR (1 << 0) -#define GALLIVM_PERF_NO_RHO_APPROX (1 << 1) +#define GALLIVM_PERF_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) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index bfb457784fa..bec04653da2 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -56,12 +56,11 @@ unsigned gallivm_perf = 0; static const struct debug_named_value lp_bld_perf_flags[] = { { "brilinear", GALLIVM_PERF_BRILINEAR, "enable brilinear optimization" }, - { "no_rho_approx", GALLIVM_PERF_NO_RHO_APPROX, "disable rho_approx optimization" }, + { "rho_approx", GALLIVM_PERF_RHO_APPROX, "enable 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_RHO_APPROX | - GALLIVM_PERF_NO_QUAD_LOD, "disable filter optimization hacks" }, + { "no_filter_hacks", GALLIVM_PERF_NO_QUAD_LOD, "disable filter optimization hacks" }, DEBUG_NAMED_VALUE_END }; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index e31ca78c5b9..ce58db67e79 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -3358,7 +3358,7 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, if (gallivm_perf & GALLIVM_PERF_NO_QUAD_LOD || op_is_lodq) { bld.no_quad_lod = TRUE; } - if (gallivm_perf & GALLIVM_PERF_NO_RHO_APPROX || op_is_lodq) { + if (!(gallivm_perf & GALLIVM_PERF_RHO_APPROX) || op_is_lodq) { bld.no_rho_approx = TRUE; } if (!(gallivm_perf & GALLIVM_PERF_BRILINEAR) || op_is_lodq || lod_bias || explicit_lod) {