From db3fa1cc8c912ed86b2233d49c52528999f25f5f Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 3 May 2021 13:35:40 +0200 Subject: [PATCH] v3dv: setup loop unrolling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We set the maximum at 16 iterations (the GL compiler chooses 32 iterations for the GLSL front-end loop unrolling pass) because we have observed a bunch of shaders from Sascha Willems that spill significantly with 32, leading to massive performance degradation, while 16 avoids spilling and doesn't seem to cause visible performance degradation compared to cases that unroll 32 without spilling. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/vulkan/v3dv_pipeline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index e6bebd905f6..dc9ff724d4b 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -233,6 +233,7 @@ const nir_shader_compiler_options v3dv_nir_options = { .vertex_id_zero_based = false, /* FIXME: to set this to true, the intrinsic * needs to be supported */ .lower_interpolate_at = true, + .max_unroll_iterations = 16, .divergence_analysis_options = nir_divergence_multiple_workgroup_per_compute_subgroup };