* after culling is implemented. */
if (es_sel->so.num_outputs)
esvert_lds_size = 4 * es_sel->info.num_outputs + 1;
+
+ /* GS stores Primitive IDs into LDS at the address corresponding
+ * to the ES thread of the provoking vertex. All ES threads
+ * load and export PrimitiveID for their thread.
+ */
+ if (gs_sel->type == PIPE_SHADER_VERTEX &&
+ shader->key.mono.u.vs_export_prim_id)
+ esvert_lds_size = MAX2(esvert_lds_size, 1);
}
unsigned max_gsprims = max_gsprims_base;
struct ac_rtld_symbol lds_symbols[2];
unsigned num_lds_symbols = 0;
- unsigned esgs_ring_size = 0;
- if (sel && screen->info.chip_class >= GFX9 &&
- sel->type == PIPE_SHADER_GEOMETRY && !shader->is_gs_copy_shader) {
- esgs_ring_size = shader->gs_info.esgs_ring_size;
- }
-
- if (sel && shader->key.as_ngg) {
- if (sel->type != PIPE_SHADER_GEOMETRY && sel->so.num_outputs) {
- unsigned esgs_vertex_bytes = 4 * (4 * sel->info.num_outputs + 1);
- esgs_ring_size = MAX2(esgs_ring_size,
- shader->ngg.max_out_verts * esgs_vertex_bytes);
- }
-
- /* GS stores Primitive IDs into LDS at the address corresponding
- * to the ES thread of the provoking vertex. All ES threads
- * load and export PrimitiveID for their thread.
- */
- if (sel->type == PIPE_SHADER_VERTEX &&
- shader->key.mono.u.vs_export_prim_id)
- esgs_ring_size = MAX2(esgs_ring_size, shader->ngg.max_out_verts * 4);
- }
-
- if (esgs_ring_size) {
+ if (sel && screen->info.chip_class >= GFX9 && !shader->is_gs_copy_shader &&
+ (sel->type == PIPE_SHADER_GEOMETRY || shader->key.as_ngg)) {
/* We add this symbol even on LLVM <= 8 to ensure that
* shader->config.lds_size is set correctly below.
*/
struct ac_rtld_symbol *sym = &lds_symbols[num_lds_symbols++];
sym->name = "esgs_ring";
- sym->size = esgs_ring_size;
+ sym->size = shader->gs_info.esgs_ring_size;
sym->align = 64 * 1024;
}