radeonsi: remove the NGG hack decreasing LDS usage to deal with overflows
authorMarek Olšák <marek.olsak@amd.com>
Thu, 30 Jul 2020 12:32:15 +0000 (08:32 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 7 Aug 2020 15:22:22 +0000 (11:22 -0400)
The LDS size can't overflow anymore, so we can use the correct max LDS size.

Fixes: a23802bcb9a - ac,radeonsi: start adding support for gfx10.3
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6137>

src/gallium/drivers/radeonsi/gfx10_shader_ngg.c

index b484ebae5225b4ba4d1cb58284e68a802c5fe837..0654ab32855f646bb3e1c8f086177fed087f5a48 100644 (file)
@@ -1917,14 +1917,9 @@ bool gfx10_ngg_calculate_subgroup_info(struct si_shader *shader)
    const unsigned min_verts_per_prim = gs_type == PIPE_SHADER_GEOMETRY ? max_verts_per_prim : 1;
 
    /* All these are in dwords: */
    const unsigned min_verts_per_prim = gs_type == PIPE_SHADER_GEOMETRY ? max_verts_per_prim : 1;
 
    /* All these are in dwords: */
-   /* We can't allow using the whole LDS, because GS waves compete with
-    * other shader stages for LDS space.
-    *
-    * TODO: We should really take the shader's internal LDS use into
-    *       account. The linker will fail if the size is greater than
-    *       8K dwords.
+   /* GE can only use 8K dwords (32KB) of LDS per workgroup.
     */
     */
-   const unsigned max_lds_size = 8 * 1024 - 768;
+   const unsigned max_lds_size = 8 * 1024 - gfx10_ngg_get_scratch_dw_size(shader);
    const unsigned target_lds_size = max_lds_size;
    unsigned esvert_lds_size = 0;
    unsigned gsprim_lds_size = 0;
    const unsigned target_lds_size = max_lds_size;
    unsigned esvert_lds_size = 0;
    unsigned gsprim_lds_size = 0;