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>
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,