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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34549>
This commit is contained in:
Samuel Pitoiset 2025-04-16 12:46:55 +02:00 committed by Marge Bot
parent e433a57650
commit 710d7ea8b8

View file

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