radeonsi/gfx10: clean up ESGS ring size computation

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
Marek Olšák 2019-07-05 22:19:47 -04:00
parent 37db9d2865
commit 1b4354dab9
2 changed files with 11 additions and 24 deletions

View file

@ -1328,6 +1328,14 @@ void gfx10_ngg_calculate_subgroup_info(struct si_shader *shader)
* 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;

View file

@ -5234,36 +5234,15 @@ static bool si_shader_binary_open(struct si_screen *screen,
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;
}