gallivm: Make it possible to disable some optimization shortcuts in release builds
authorGert Wollny <gert.wollny@collabora.com>
Fri, 5 Oct 2018 13:08:51 +0000 (15:08 +0200)
committerGert Wollny <gw.fossdev@gmail.com>
Sat, 6 Oct 2018 11:12:48 +0000 (13:12 +0200)
commit8f77156c268356baf9df8490c52cc5d8475b9db8
treec051020bd85fdeec438d6b3d937c15740517badc
parent9d81cd8e7c0cb44e09cf650da4834a1dc647a4d2
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 <gert.wollny@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_debug.h
src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c