radv/gfx10: adjust the LDS size used to compute waves
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Feb 2020 07:50:29 +0000 (08:50 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 26 Feb 2020 07:58:47 +0000 (07:58 +0000)
It's 128KB per CU in WGP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3899>

src/amd/vulkan/radv_shader.c

index cad95f830aae5c803f22a54acf170679abb01f14..1220b4ae8b7466cfd6e3c13439087e7f318f0339 100644 (file)
@@ -1336,11 +1336,9 @@ radv_get_max_waves(struct radv_device *device,
                             RADV_NUM_PHYSICAL_VGPRS / vgprs);
        }
 
-       /* LDS is 64KB per CU (4 SIMDs), divided into 16KB blocks per SIMD
-        * that PS can use.
-        */
+       unsigned max_lds_per_simd = device->physical_device->rad_info.lds_size_per_cu / device->physical_device->rad_info.num_simd_per_compute_unit;
        if (lds_per_wave)
-               max_simd_waves = MIN2(max_simd_waves, 16384 / lds_per_wave);
+               max_simd_waves = MIN2(max_simd_waves, max_lds_per_simd / lds_per_wave);
 
        return max_simd_waves;
 }