From 8f77156c268356baf9df8490c52cc5d8475b9db8 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 5 Oct 2018 15:08:51 +0200 Subject: gallivm: Make it possible to disable some optimization shortcuts in release builds For testing it is of interest that all tests of dEQP pass, e.g. to test virglrenderer on a host only providing software rendering like in a CI. Hence make it possible to disable certain optimizations that make tests fail. While we are there also add some documentation to the flags to make it clear that this is opt-out. Setting the environment variable "GALLIVM_PERF=no_filter_hacks" can be used to make the following tests pass in release mode: dEQP-GLES2.functional.texture.mipmap.2d.affine.*_linear_* dEQP-GLES2.functional.texture.mipmap.cube.generate.* dEQP-GLES2.functional.texture.vertex.2d.filtering.*_mipmap_linear_* dEQP-GLES2.functional.texture.vertex.2d.wrap.* Related: https://bugs.freedesktop.org/show_bug.cgi?id=94957 v2: rename optimization disabling flag to 'safemath' and also move the nopt flag to the perf flags. v3: rename flag "safemath" to "no_filter_hacks" since safemath is usually associated with floating point operations (Roland) Signed-off-by: Gert Wollny Reviewed-by: Roland Scheidegger --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 79ece639e35..5fecad4ea67 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -2037,7 +2037,7 @@ lp_build_lod_property( lod_property = LP_SAMPLER_LOD_SCALAR; } else if (bld_base->info->processor == PIPE_SHADER_FRAGMENT) { - if (gallivm_debug & GALLIVM_DEBUG_NO_QUAD_LOD) { + if (gallivm_perf & GALLIVM_PERF_NO_QUAD_LOD) { lod_property = LP_SAMPLER_LOD_PER_ELEMENT; } else { @@ -2225,7 +2225,7 @@ emit_tex( struct lp_build_tgsi_soa_context *bld, * cases exist in practice. */ if (bld->bld_base.info->processor == PIPE_SHADER_FRAGMENT) { - if (gallivm_debug & GALLIVM_DEBUG_NO_QUAD_LOD) { + if (gallivm_perf & GALLIVM_PERF_NO_QUAD_LOD) { lod_property = LP_SAMPLER_LOD_PER_ELEMENT; } else { @@ -2394,7 +2394,7 @@ emit_sample(struct lp_build_tgsi_soa_context *bld, * cases exist in practice. */ if (bld->bld_base.info->processor == PIPE_SHADER_FRAGMENT) { - if (gallivm_debug & GALLIVM_DEBUG_NO_QUAD_LOD) { + if (gallivm_perf & GALLIVM_PERF_NO_QUAD_LOD) { lod_property = LP_SAMPLER_LOD_PER_ELEMENT; } else { -- cgit v1.2.3