st/nir: Don't use GLSL IR's MOD_TO_FLOOR lowering when using NIR.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 17 May 2019 05:41:13 +0000 (22:41 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 5 Jun 2019 23:45:12 +0000 (16:45 -0700)
commit4f3c82c72c57acd4800e12ec77ad1b830812072c
tree86e4c72991e5dc041ca6c6c0337b692967c39556
parentf4d4c426084127d88aba11f22b4f33ff93700963
st/nir: Don't use GLSL IR's MOD_TO_FLOOR lowering when using NIR.

Both GLSL IR and NIR perform the same mod -> floor lowering for 32-bit
types.  But nir_lower_double_ops is slightly more defensive against
lowered drcp precision loss, and handles mod(x, x) = 0 directly.  This
works well...assuming nir_lower_double_ops actually gets an fmod op to
lower in the first place.

The previous patches enabled NIR-based lowering for the remaining
drivers, so we can stop using the GLSL IR lowering when using NIR.

Fixes KHR-GL45.gpu_shader_fp64.builtin.mod_dvec[234] on iris.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_ir.cpp