From 7ae5a93b7f43729a27186d810cf190ca5d67915e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Tue, 14 Sep 2021 19:06:10 +0200 Subject: [PATCH] radv: Select PC oversubscription rate based on number of PS params. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decide the oversubscription rate similarly to how RadeonSI does it: Oversubscribe a smaller amount of PC (parameter cache) when there are fewer params. Signed-off-by: Timur Kristóf Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index ef50a259338..5425b9e375b 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -4657,8 +4657,16 @@ radv_pipeline_generate_hw_ngg(struct radeon_cmdbuf *ctx_cs, struct radeon_cmdbuf S_00B204_CU_EN(0xffff) | S_00B204_SPI_SHADER_LATE_ALLOC_GS_GFX10(late_alloc_wave64)); uint32_t oversub_pc_lines = late_alloc_wave64 ? pipeline->device->physical_device->rad_info.pc_lines / 4 : 0; - if (shader->info.has_ngg_culling) - oversub_pc_lines *= 3; + if (shader->info.has_ngg_culling) { + unsigned oversub_factor = 2; + + if (outinfo->param_exports > 4) + oversub_factor = 4; + else if (outinfo->param_exports > 2) + oversub_factor = 3; + + oversub_pc_lines *= oversub_factor; + } gfx10_emit_ge_pc_alloc(cs, pipeline->device->physical_device->rad_info.chip_class, oversub_pc_lines); }