radv/gfx10: adjust the LDS size for VS/TES NGG streamout
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 9 Sep 2019 08:42:18 +0000 (10:42 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 16 Sep 2019 10:08:22 +0000 (12:08 +0200)
It should account for the number of streamout outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index 48ea2c0..8b523d8 100644 (file)
@@ -1729,15 +1729,16 @@ gfx10_get_ngg_info(const VkGraphicsPipelineCreateInfo *pCreateInfo,
                esvert_lds_size = es_info->esgs_itemsize / 4;
                gsprim_lds_size = (gs_info->gs.gsvs_vertex_size / 4 + 1) * max_out_verts_per_gsprim;
        } else {
-               /* TODO: This needs to be adjusted once LDS use for compaction
-                * after culling is implemented. */
-               /*
-               if (es_info->info.so.num_outputs)
-                       esvert_lds_size = 4 * es_info->info.so.num_outputs + 1;
-               */
+               /* VS and TES. */
+               /* LDS size for passing data from GS to ES. */
+               struct radv_streamout_info *so_info = nir[MESA_SHADER_TESS_CTRL]
+                       ? &infos[MESA_SHADER_TESS_EVAL].so
+                       : &infos[MESA_SHADER_VERTEX].so;
+
+               if (so_info->num_outputs)
+                       esvert_lds_size = 4 * so_info->num_outputs + 1;
 
-               /* LDS size for passing data from GS to ES.
-                * GS stores Primitive IDs (one DWORD) into LDS at the address
+               /* GS stores Primitive IDs (one DWORD) into LDS at the address
                 * corresponding to the ES thread of the provoking vertex. All
                 * ES threads load and export PrimitiveID for their thread.
                 */