Module: Mesa
Branch: main
Commit: 7ae5a93b7f43729a27186d810cf190ca5d67915e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ae5a93b7f43729a27186d810cf190ca5d67915e

Author: Timur Kristóf <[email protected]>
Date:   Tue Sep 14 19:06:10 2021 +0200

radv: Select PC oversubscription rate based on number of PS params.

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 <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12859>

---

 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);
 }

Reply via email to