Skip to content

st/nir: Don't use GLSL IR's MOD_TO_FLOOR lowering if nir_lower_dmod set

Kenneth Graunke requested to merge kwg/mesa:iris-dmod into master

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.

If drivers have requested dmod lowering, assume they're doing all their fmod handling in NIR and shut off the GLSL IR pass. Apparently iris is the only driver requesting dmod lowering today.

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

Merge request reports