Fixes: 028d0590f85 ("radeonsi: replace llvm ngg vs/tes with nir lowering")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
const unsigned min_verts_per_prim = gs_stage == MESA_SHADER_GEOMETRY ? max_verts_per_prim : 1;
/* All these are in dwords. The maximum is 16K dwords (64KB) of LDS per workgroup. */
- const unsigned max_lds_size = 16 * 1024 - gfx10_ngg_get_scratch_dw_size(shader);
+ const unsigned scratch_lds_size = gfx10_ngg_get_scratch_dw_size(shader);
+ /* Scrach is at last of LDS space and 2 dwords aligned, so it may cost more for alignment. */
+ const unsigned max_lds_size = 16 * 1024 - ALIGN(scratch_lds_size, 2);
const unsigned target_lds_size = max_lds_size;
unsigned esvert_lds_size = 0;
unsigned gsprim_lds_size = 0;