radv: add a new user SGPR for the ESGS ring item size
With shader object, when VS+GS or TES+GS are compiled separately and the VS has written (but unused) outputs, the ESGS vertex stride must be passed through an user SGPR. This is because when the GS is compiled we can't know the number of ES outputs. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
This commit is contained in:

committed by
Marge Bot

parent
5b1b76e9cd
commit
d777cbf66c
@@ -211,11 +211,12 @@ enum radv_ud_index {
|
||||
AC_UD_NGG_PROVOKING_VTX = 7,
|
||||
AC_UD_NGG_CULLING_SETTINGS = 8,
|
||||
AC_UD_NGG_VIEWPORT = 9,
|
||||
AC_UD_FORCE_VRS_RATES = 10,
|
||||
AC_UD_TASK_RING_ENTRY = 11,
|
||||
AC_UD_NUM_VERTS_PER_PRIM = 12,
|
||||
AC_UD_NEXT_STAGE_PC = 13,
|
||||
AC_UD_SHADER_START = 14,
|
||||
AC_UD_VGT_ESGS_RING_ITEMSIZE = 10,
|
||||
AC_UD_FORCE_VRS_RATES = 11,
|
||||
AC_UD_TASK_RING_ENTRY = 12,
|
||||
AC_UD_NUM_VERTS_PER_PRIM = 13,
|
||||
AC_UD_NEXT_STAGE_PC = 14,
|
||||
AC_UD_SHADER_START = 15,
|
||||
AC_UD_VS_VERTEX_BUFFERS = AC_UD_SHADER_START,
|
||||
AC_UD_VS_BASE_VERTEX_START_INSTANCE,
|
||||
AC_UD_VS_PROLOG_INPUTS,
|
||||
|
@@ -707,8 +707,10 @@ declare_shader_args(const struct radv_device *device, const struct radv_graphics
|
||||
declare_ngg_sgprs(info, args, has_ngg_provoking_vtx);
|
||||
}
|
||||
|
||||
if (info->merged_shader_compiled_separately)
|
||||
if (info->merged_shader_compiled_separately) {
|
||||
add_ud_arg(args, 1, AC_ARG_INT, &args->vgt_esgs_ring_itemsize, AC_UD_VGT_ESGS_RING_ITEMSIZE);
|
||||
add_ud_arg(args, 1, AC_ARG_INT, &args->next_stage_pc, AC_UD_NEXT_STAGE_PC);
|
||||
}
|
||||
|
||||
if (previous_stage != MESA_SHADER_MESH || !device->mesh_fast_launch_2) {
|
||||
ac_add_arg(&args->ac, AC_ARG_VGPR, 1, AC_ARG_INT, &args->ac.gs_vtx_offset[0]);
|
||||
@@ -749,6 +751,7 @@ declare_shader_args(const struct radv_device *device, const struct radv_graphics
|
||||
ac_add_preserved(&args->ac, &args->shader_query_state);
|
||||
if (info->is_ngg)
|
||||
ac_add_preserved(&args->ac, &args->ngg_provoking_vtx);
|
||||
ac_add_preserved(&args->ac, &args->vgt_esgs_ring_itemsize);
|
||||
|
||||
/* VGPRs */
|
||||
ac_add_preserved(&args->ac, &args->ac.gs_vtx_offset[0]);
|
||||
|
@@ -86,6 +86,9 @@ struct radv_shader_args {
|
||||
*/
|
||||
struct ac_arg tes_state;
|
||||
|
||||
/* GS */
|
||||
struct ac_arg vgt_esgs_ring_itemsize;
|
||||
|
||||
/* NGG VS streamout */
|
||||
struct ac_arg num_verts_per_prim;
|
||||
|
||||
|
Reference in New Issue
Block a user