state_tracker: Lower frexp before lowering doubles.

We don't have softfp64 for frexp, it has been lowered in GLSL up until
now.  I didn't bother splitting out 32 from 64 because it's not worth any
effort.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
This commit is contained in:
Emma Anholt 2023-03-23 11:49:14 -07:00 committed by Marge Bot
parent 261c1f9ee1
commit fb60edf4e9

View file

@ -542,6 +542,14 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog,
NIR_PASS(revectorize, nir, nir_lower_alu_to_scalar, filter_64_bit_instr, nullptr);
NIR_PASS(revectorize, nir, nir_lower_phis_to_scalar, false);
}
/* doubles lowering requires frexp to be lowered first if it will be,
* since the pass generates other 64-bit ops. Most backends lower
* frexp, and using doubles is rare, and using frexp is even more rare
* (no instances in shader-db), so we're not too worried about
* accidentally lowering a 32-bit frexp here.
*/
NIR_PASS(lowered_64bit_ops, nir, nir_lower_frexp);
NIR_PASS(lowered_64bit_ops, nir, nir_lower_doubles,
st->ctx->SoftFP64, nir->options->lower_doubles_options);
}