radv: Properly set LDS size for LLVM NGG shaders.

Update the esgs_ring_size after ac_nir_lower_ngg.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12792>
This commit is contained in:
Timur Kristóf 2022-05-17 18:51:54 +02:00 committed by Marge Bot
parent d3dcd294c0
commit 45ed22c87e
1 changed files with 6 additions and 1 deletions

View File

@ -1325,6 +1325,9 @@ void radv_lower_ngg(struct radv_device *device, struct radv_pipeline_stage *ngg_
info->has_ngg_early_prim_export, info->is_ngg_passthrough, export_prim_id,
pl_key->vs.provoking_vtx_last, false, pl_key->primitives_generated_query,
pl_key->vs.instance_rate_inputs);
/* Increase ESGS ring size so the LLVM binary contains the correct LDS size. */
ngg_stage->info.ngg_info.esgs_ring_size = nir->info.shared_size;
} else if (nir->info.stage == MESA_SHADER_GEOMETRY) {
assert(info->is_ngg);
NIR_PASS_V(nir, ac_nir_lower_ngg_gs, info->wave_size, info->workgroup_size,
@ -1999,13 +2002,15 @@ radv_shader_create(struct radv_device *device, const struct radv_shader_binary *
if (rtld_binary.lds_size > 0) {
unsigned encode_granularity = device->physical_device->rad_info.lds_encode_granularity;
config.lds_size = align(rtld_binary.lds_size, encode_granularity) / encode_granularity;
config.lds_size = DIV_ROUND_UP(rtld_binary.lds_size, encode_granularity);
}
if (!config.lds_size && binary->stage == MESA_SHADER_TESS_CTRL) {
/* This is used for reporting LDS statistics */
config.lds_size = binary->info.tcs.num_lds_blocks;
}
assert(!binary->info.has_ngg_culling || config.lds_size);
shader->code_size = rtld_binary.rx_size;
shader->exec_size = rtld_binary.exec_size;
ac_rtld_close(&rtld_binary);