From 499abeba605da7f7395c84b0a75c917656c19949 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 17 Nov 2022 07:53:24 +0100 Subject: [PATCH] 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 Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 0eb9a775911..e633afe92ed 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -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,