From d2ab0ed31e1b50c27da4453d09a12b0acbaa5190 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 4 May 2022 17:16:47 -0700 Subject: [PATCH] svga: Set lower_bitops for vpu9 screen. Since these don't have native integers, nir_lower_io generating ishls instead of amuls for uniform addressing math runs afoul of nir_lower_int_to_float. Reviewed-by: Charmaine Lee Part-of: --- src/gallium/drivers/svga/svga_screen.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 3feb253..a0c3cc8 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -756,7 +756,23 @@ vgpu10_get_shader_param(struct pipe_screen *screen, return 0; } -static const nir_shader_compiler_options svga_compiler_options = { +static const nir_shader_compiler_options svga_vgpu9_compiler_options = { + .lower_bitops = true, + .lower_extract_byte = true, + .lower_extract_word = true, + .lower_insert_byte = true, + .lower_insert_word = true, + .lower_fdph = true, + .lower_flrp64 = true, + .lower_rotate = true, + .lower_uniforms_to_ubo = true, + .lower_vector_cmp = true, + + .max_unroll_iterations = 32, + .use_interpolated_input_intrinsics = true, +}; + +static const nir_shader_compiler_options svga_vgpu10_compiler_options = { .lower_extract_byte = true, .lower_extract_word = true, .lower_insert_byte = true, @@ -776,9 +792,15 @@ svga_get_compiler_options(struct pipe_screen *pscreen, enum pipe_shader_ir ir, enum pipe_shader_type shader) { + struct svga_screen *svgascreen = svga_screen(pscreen); + struct svga_winsys_screen *sws = svgascreen->sws; + assert(ir == PIPE_SHADER_IR_NIR); - return &svga_compiler_options; + if (sws->have_vgpu10) + return &svga_vgpu10_compiler_options; + else + return &svga_vgpu9_compiler_options; } static int -- 2.7.4