From 465f249ec89bce91a5b523e63d12560ba7b855cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 20 Sep 2021 07:44:50 -0400 Subject: [PATCH] radeonsi: change the units of oversub_pc_factor to integer multiples of 1/4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit to match radv Reviewed-by: Timur Kristóf Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_state_shaders.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 59ac9c1..8a78c92 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1288,19 +1288,20 @@ static void gfx10_shader_ngg(struct si_screen *sscreen, struct si_shader *shader shader->pa_cl_vs_out_cntl = si_get_vs_out_cntl(shader->selector, shader, true); /* Oversubscribe PC. This improves performance when there are too many varyings. */ - float oversub_pc_factor = 0.25; + unsigned oversub_pc_factor = 1; if (shader->key.opt.ngg_culling) { /* Be more aggressive with NGG culling. */ if (shader->info.nr_param_exports > 4) - oversub_pc_factor = 1; + oversub_pc_factor = 4; else if (shader->info.nr_param_exports > 2) - oversub_pc_factor = 0.75; + oversub_pc_factor = 3; else - oversub_pc_factor = 0.5; + oversub_pc_factor = 2; } - unsigned oversub_pc_lines = late_alloc_wave64 ? sscreen->info.pc_lines * oversub_pc_factor : 0; + unsigned oversub_pc_lines = + late_alloc_wave64 ? (sscreen->info.pc_lines / 4) * oversub_pc_factor : 0; shader->ctx_reg.ngg.ge_pc_alloc = S_030980_OVERSUB_EN(oversub_pc_lines > 0) | S_030980_NUM_PC_LINES(oversub_pc_lines - 1); -- 2.7.4