From: Vasily Khoruzhick Date: Wed, 1 May 2019 05:25:23 +0000 (-0700) Subject: lima: use int_to_float lowering pass X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf1ab4b96b15d7c7baf2cbd43e842f0172da5290;p=mesa.git lima: use int_to_float lowering pass Neither GP nor PP in Mali4x0 support integers, so utilize new pass and set native_integers to true for now until this flag is dropped. Reviewed-by: Qiang Yu Signed-off-by: Vasily Khoruzhick --- diff --git a/src/gallium/drivers/lima/lima_program.c b/src/gallium/drivers/lima/lima_program.c index 98416471e67..21e64fb6aaf 100644 --- a/src/gallium/drivers/lima/lima_program.c +++ b/src/gallium/drivers/lima/lima_program.c @@ -49,6 +49,7 @@ static const nir_shader_compiler_options vs_nir_options = { .lower_flrp64 = true, /* could be implemented by clamp */ .lower_fsat = true, + .native_integers = true, }; static const nir_shader_compiler_options fs_nir_options = { @@ -58,6 +59,7 @@ static const nir_shader_compiler_options fs_nir_options = { .lower_flrp32 = true, .lower_flrp64 = true, .lower_fsign = true, + .native_integers = true, }; const void * @@ -90,7 +92,6 @@ lima_program_optimize_vs_nir(struct nir_shader *s) NIR_PASS_V(s, lima_nir_lower_uniform_to_scalar); NIR_PASS_V(s, nir_lower_io_to_scalar, nir_var_shader_in|nir_var_shader_out); - NIR_PASS_V(s, nir_lower_bool_to_float); do { progress = false; @@ -113,6 +114,8 @@ lima_program_optimize_vs_nir(struct nir_shader *s) nir_var_function_temp); } while (progress); + NIR_PASS_V(s, nir_lower_int_to_float); + NIR_PASS_V(s, nir_copy_prop); NIR_PASS_V(s, nir_lower_locals_to_regs); NIR_PASS_V(s, nir_convert_from_ssa, true); NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp); @@ -127,7 +130,6 @@ lima_program_optimize_fs_nir(struct nir_shader *s) NIR_PASS_V(s, nir_lower_fragcoord_wtrans); NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, 0); NIR_PASS_V(s, nir_lower_regs_to_ssa); - NIR_PASS_V(s, nir_lower_bool_to_float); do { progress = false; @@ -150,6 +152,8 @@ lima_program_optimize_fs_nir(struct nir_shader *s) nir_var_function_temp); } while (progress); + NIR_PASS_V(s, nir_lower_int_to_float); + /* Lower modifiers */ NIR_PASS_V(s, nir_lower_to_source_mods, nir_lower_all_source_mods); NIR_PASS_V(s, nir_copy_prop);