From 5a3be2db24ed6d74e2605dedcee0a767303f469b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Thu, 19 May 2022 09:49:05 +0200 Subject: [PATCH] r300: deduplicate common NIR options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Ondračka Reviewed-by: Filip Gawin Part-of: --- src/gallium/drivers/r300/r300_screen.c | 105 ++++++------------------- 1 file changed, 25 insertions(+), 80 deletions(-) diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 2b51a8859ac..72e937b7e45 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -488,117 +488,62 @@ static int r300_get_video_param(struct pipe_screen *screen, } } +#define COMMON_NIR_OPTIONS \ + .fdot_replicates = true, \ + .fuse_ffma32 = true, \ + .fuse_ffma64 = true, \ + .lower_bitops = true, \ + .lower_extract_byte = true, \ + .lower_extract_word = true, \ + .lower_fdiv = true, \ + .lower_fdph = true, \ + .lower_flrp32 = true, \ + .lower_flrp64 = true, \ + .lower_fmod = true, \ + .lower_fround_even = true, \ + .lower_insert_byte = true, \ + .lower_insert_word = true, \ + .lower_rotate = true, \ + .lower_uniforms_to_ubo = true, \ + .lower_vector_cmp = true, \ + .no_integers = true, \ + .use_interpolated_input_intrinsics = true + static const nir_shader_compiler_options r500_vs_compiler_options = { - .fdot_replicates = true, - .fuse_ffma32 = true, - .fuse_ffma64 = true, - .lower_bitops = true, - .lower_extract_byte = true, - .lower_extract_word = true, - .lower_fdiv = true, - .lower_insert_byte = true, - .lower_insert_word = true, - .lower_fdph = true, - .lower_flrp32 = true, - .lower_flrp64 = true, - .lower_fmod = true, - .lower_fround_even = true, - .lower_rotate = true, - .lower_uniforms_to_ubo = true, - .lower_vector_cmp = true, + COMMON_NIR_OPTIONS, /* Have HW loops support and 1024 max instr count, but don't unroll *too* * hard. */ .max_unroll_iterations = 32, - - .use_interpolated_input_intrinsics = true, - .no_integers = true, }; static const nir_shader_compiler_options r500_fs_compiler_options = { - .fdot_replicates = true, - .fuse_ffma32 = true, - .fuse_ffma64 = true, - .lower_bitops = true, - .lower_extract_byte = true, - .lower_extract_word = true, - .lower_fdiv = true, - .lower_insert_byte = true, - .lower_insert_word = true, - .lower_fdph = true, + COMMON_NIR_OPTIONS, .lower_fpow = true, /* POW is only in the VS */ - .lower_flrp32 = true, - .lower_flrp64 = true, - .lower_fmod = true, - .lower_fround_even = true, - .lower_rotate = true, - .lower_uniforms_to_ubo = true, - .lower_vector_cmp = true, /* Have HW loops support and 512 max instr count, but don't unroll *too* * hard. */ .max_unroll_iterations = 32, - - .use_interpolated_input_intrinsics = true, - .no_integers = true, }; static const nir_shader_compiler_options r300_vs_compiler_options = { - .fdot_replicates = true, - .fuse_ffma32 = true, - .fuse_ffma64 = true, - .lower_bitops = true, - .lower_extract_byte = true, - .lower_extract_word = true, - .lower_fdiv = true, - .lower_insert_byte = true, - .lower_insert_word = true, - .lower_fdph = true, + COMMON_NIR_OPTIONS, .lower_fsat = true, /* No fsat in pre-r500 VS */ - .lower_flrp32 = true, - .lower_flrp64 = true, - .lower_fmod = true, - .lower_fround_even = true, - .lower_rotate = true, - .lower_uniforms_to_ubo = true, - .lower_vector_cmp = true, .lower_sincos = true, /* Note: has HW loops support, but only 256 ALU instructions. */ .max_unroll_iterations = 32, - - .use_interpolated_input_intrinsics = true, - .no_integers = true, }; static const nir_shader_compiler_options r300_fs_compiler_options = { - .fdot_replicates = true, - .fuse_ffma32 = true, - .fuse_ffma64 = true, - .lower_bitops = true, - .lower_extract_byte = true, - .lower_extract_word = true, - .lower_fdiv = true, + COMMON_NIR_OPTIONS, .lower_fpow = true, /* POW is only in the VS */ - .lower_insert_byte = true, - .lower_insert_word = true, - .lower_fdph = true, - .lower_flrp32 = true, - .lower_flrp64 = true, - .lower_fmod = true, - .lower_fround_even = true, - .lower_rotate = true, - .lower_uniforms_to_ubo = true, - .lower_vector_cmp = true, .lower_sincos = true, /* No HW loops support, so set it equal to ALU instr max */ .max_unroll_iterations = 64, - - .use_interpolated_input_intrinsics = true, - .no_integers = true, }; static const void *