radv: stop overallocating LDS for VS/TES when NGG streamout is enabled

The number of shader outputs should only be considered when the
shader has XFB, otherwise we are overallocating LDS.

fossils-db (GFX1100):
Totals from 16602 (12.31% of 134913) affected shaders:
LDS: 17000448 -> 8500224 (-50.00%)

Cc: 22.3 mesa-stable
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/19801>
This commit is contained in:
Samuel Pitoiset 2022-11-17 07:53:24 +01:00 committed by Marge Bot
parent 8b8d14f906
commit 499abeba60

View file

@ -1352,10 +1352,11 @@ setup_ngg_lds_layout(struct radv_device *device, nir_shader *nir, struct radv_sh
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_INSTANCE_ID);
bool uses_primtive_id =
BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_PRIMITIVE_ID);
bool streamout_enabled = nir->xfb_info && device->physical_device->use_ngg_streamout;
unsigned pervertex_lds_bytes =
ac_ngg_nogs_get_pervertex_lds_size(stage,
nir->num_outputs,
device->physical_device->use_ngg_streamout,
streamout_enabled,
info->outinfo.export_prim_id,
false, /* user edge flag */
info->has_ngg_culling,