radv: Add TES num_linked_patch_inputs.

Not needed by actual driver functionality, but will be
used for reporting I/O stats.

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/29209>
This commit is contained in:
Timur Kristóf
2024-05-14 17:29:56 +02:00
committed by Marge Bot
parent 4a6d7e79ad
commit 590fff6906
3 changed files with 7 additions and 2 deletions

View File

@@ -1397,6 +1397,7 @@ radv_link_tcs(const struct radv_device *device, struct radv_shader_stage *tcs_st
tcs_stage->info.outputs_linked = true; tcs_stage->info.outputs_linked = true;
tes_stage->info.tes.num_linked_inputs = num_reserved_outputs; tes_stage->info.tes.num_linked_inputs = num_reserved_outputs;
tes_stage->info.tes.num_linked_patch_inputs = num_reserved_patch_outputs;
tes_stage->info.inputs_linked = true; tes_stage->info.inputs_linked = true;
} }

View File

@@ -587,9 +587,12 @@ gather_shader_info_tes(struct radv_device *device, const nir_shader *nir, struct
info->tes.reads_tess_factors = info->tes.reads_tess_factors =
!!(nir->info.inputs_read & (VARYING_BIT_TESS_LEVEL_INNER | VARYING_BIT_TESS_LEVEL_OUTER)); !!(nir->info.inputs_read & (VARYING_BIT_TESS_LEVEL_INNER | VARYING_BIT_TESS_LEVEL_OUTER));
if (!info->inputs_linked) if (!info->inputs_linked) {
info->tes.num_linked_inputs = util_last_bit64(radv_gather_unlinked_io_mask( info->tes.num_linked_inputs = util_last_bit64(radv_gather_unlinked_io_mask(
nir->info.inputs_read & ~(VARYING_BIT_TESS_LEVEL_OUTER | VARYING_BIT_TESS_LEVEL_INNER))); nir->info.inputs_read & ~(VARYING_BIT_TESS_LEVEL_OUTER | VARYING_BIT_TESS_LEVEL_INNER)));
info->tes.num_linked_patch_inputs = util_last_bit64(
radv_gather_unlinked_patch_io_mask(nir->info.inputs_read, nir->info.patch_inputs_read));
}
if (!info->outputs_linked) if (!info->outputs_linked)
info->tes.num_linked_outputs = util_last_bit64(radv_gather_unlinked_io_mask(nir->info.outputs_written)); info->tes.num_linked_outputs = util_last_bit64(radv_gather_unlinked_io_mask(nir->info.outputs_written));

View File

@@ -151,7 +151,8 @@ struct radv_shader_info {
bool point_mode; bool point_mode;
bool reads_tess_factors; bool reads_tess_factors;
unsigned tcs_vertices_out; unsigned tcs_vertices_out;
uint8_t num_linked_inputs; /* Number of reserved per-vertex input slots in VRAM. */ uint8_t num_linked_inputs; /* Number of reserved per-vertex input slots in VRAM. */
uint8_t num_linked_patch_inputs; /* Number of reserved per-patch input slots in VRAM. */
uint8_t num_linked_outputs; uint8_t num_linked_outputs;
uint32_t num_outputs; /* For NGG streamout only */ uint32_t num_outputs; /* For NGG streamout only */
} tes; } tes;