nir: add lower_bitshift option

Add a "lower_bitshift" option, which disables optimizations introducing
bitshifts and lowers ishl by constant to a multiply, so that we don't have
to deal with bitshifts in int_to_float lowering.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Jonathan Marek
2019-05-31 13:54:12 -04:00
parent 887c2a6092
commit f889180ee1
4 changed files with 10 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ static const nir_shader_compiler_options vs_nir_options = {
.lower_ftrunc = true,
/* could be implemented by clamp */
.lower_fsat = true,
.lower_bitshift = true,
};
static const nir_shader_compiler_options fs_nir_options = {