From 4932b63f36577d79a440ec1b8c2724cfe33a8be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 27 Nov 2024 22:45:17 -0500 Subject: [PATCH] v3d: enable uniform expression propagation from outputs to the next shader This will take effect after nir_opt_varyings is enabled by another MR, and will fix existing shader compiler crashes thanks to better optimizations. For example, one GLSL program that failed to compile and had 226 VS instructions and 356 FS instructions in NIR will be reduced to 2 or 3 instructions per shader. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/v3d/v3d_screen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index 706da4b294f..1b77a24cc70 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -762,6 +762,7 @@ v3d_screen_get_compiler_options(struct pipe_screen *pscreen, .max_unroll_iterations = 16, .force_indirect_unrolling_sampler = true, .scalarize_ddx = true, + .max_varying_expression_cost = 4, }; if (!initialized) {