From 5994e08f8bece743d8475486a5e92be57b86b006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 30 Apr 2025 16:42:27 -0400 Subject: [PATCH] ac: set LDS limit for TCS to 32K for all chips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Timur Kristóf Part-of: --- src/amd/common/ac_shader_util.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/amd/common/ac_shader_util.c b/src/amd/common/ac_shader_util.c index 69a7e58e435..ca868cf28e8 100644 --- a/src/amd/common/ac_shader_util.c +++ b/src/amd/common/ac_shader_util.c @@ -996,10 +996,13 @@ uint32_t ac_compute_num_tess_patches(const struct radeon_info *info, uint32_t nu * use LDS for the inputs and outputs. */ if (lds_per_patch) { - const unsigned max_lds_size = (info->gfx_level >= GFX9 ? 64 * 1024 : 32 * 1024); /* hw limit */ - /* Target at least 2 workgroups per CU. */ - const unsigned target_lds_size = max_lds_size / 2 - AC_TESS_LEVEL_VOTE_LDS_BYTES; - num_patches = MIN2(num_patches, target_lds_size / lds_per_patch); + /* LS/HS can only access up to 32K on GFX6-8 and 64K on GFX9+. + * + * 32K performs the best. We could use 64K on GFX9+, but it doesn't perform well because + * 64K prevents GS and PS from running on the same CU. + */ + const unsigned max_lds_size = 32 * 1024 - AC_TESS_LEVEL_VOTE_LDS_BYTES; + num_patches = MIN2(num_patches, max_lds_size / lds_per_patch); assert(num_patches * lds_per_patch <= max_lds_size); } num_patches = MAX2(num_patches, 1);