From 710d7ea8b8b72f9e2292d22dca6d22810e27f376 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 16 Apr 2025 12:46:55 +0200 Subject: [PATCH] radv: compute the optimal scratch wavesize This might increase the scratch BO sizes but it's supposed to be faster because scratch waves would be distributed among memory channels. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_queue.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/vulkan/radv_queue.c b/src/amd/vulkan/radv_queue.c index afc9523ffcf..7ce7b68cfc4 100644 --- a/src/amd/vulkan/radv_queue.c +++ b/src/amd/vulkan/radv_queue.c @@ -1341,6 +1341,10 @@ radv_update_preambles(struct radv_queue_state *queue, struct radv_device *device ? MIN2(needs.compute_scratch_waves, UINT32_MAX / needs.compute_scratch_size_per_wave) : 0; + /* Compute the optimal scratch wavesize. */ + needs.scratch_size_per_wave = ac_compute_scratch_wavesize(&pdev->info, needs.scratch_size_per_wave); + needs.compute_scratch_size_per_wave = ac_compute_scratch_wavesize(&pdev->info, needs.compute_scratch_size_per_wave); + if (pdev->info.gfx_level >= GFX11 && queue->qf == RADV_QUEUE_GENERAL) { needs.ge_rings = true; }