radeonsi: remove si_shader_info::output_semantic[]

It does nothing now.

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
This commit is contained in:
Marek Olšák 2026-03-19 22:04:09 -04:00 committed by Marge Bot
parent d4538b90a7
commit a4396f2da6
3 changed files with 10 additions and 34 deletions

View file

@ -546,8 +546,6 @@ static void si_nir_assign_param_offsets(nir_shader *nir, struct si_shader *shade
if (nir_slot_is_varying(sem.location, MESA_SHADER_FRAGMENT) && !sem.no_varying &&
(sem.gs_streams & 0x3) == 0 &&
temp_info->vs_output_param_offset[sem.location] == AC_EXP_PARAM_UNDEFINED) {
/* The semantic and the base should be the same as in si_shader_info. */
assert(sem.location == sel->info.output_semantic[nir_intrinsic_base(intr)]);
/* It must not be remapped (duplicated). */
assert(slot_remap[sem.location] == -1);
@ -1491,13 +1489,17 @@ bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compi
!shader->key.ge.as_ls && !shader->key.ge.as_es) {
uint8_t *vs_output_param_offset = linked.consumer.temp_info.vs_output_param_offset;
/* We must use the original shader info before the removal of duplicated shader outputs. */
/* VS and TES should also set primitive ID output if it's used. */
unsigned num_outputs_with_prim_id = sel->info.num_outputs +
shader->key.ge.mono.u.vs_export_prim_id;
/* We must use the original shader info before the removal of duplicated shader outputs.
* If any output is eliminated by shader variants, it will set DEFAULT_VAL.
*
* VS and TES must set VARYING_BIT_PRIMITIVE_ID if they export it.
*/
uint64_t outputs_written = sel->info.base.outputs_written |
(shader->key.ge.mono.u.vs_export_prim_id ?
VARYING_BIT_PRIMITIVE_ID : 0);
for (unsigned i = 0; i < num_outputs_with_prim_id; i++) {
unsigned semantic = sel->info.output_semantic[i];
u_foreach_bit64_two_masks(semantic, outputs_written,
VARYING_SLOT_VAR0_16BIT, sel->info.base.outputs_written_16bit) {
unsigned offset = vs_output_param_offset[semantic];
unsigned ps_input_cntl;

View file

@ -252,15 +252,6 @@ static void gather_io_instrinsic(const nir_shader *nir, struct si_shader_info *i
}
}
if (nir->info.stage != MESA_SHADER_FRAGMENT) {
/* No 2 outputs can use the same driver location. */
assert((info->output_semantic[loc] == slot_semantic ||
info->output_semantic[loc] == NUM_TOTAL_VARYING_SLOTS) &&
"nir_recompute_io_bases wasn't called");
info->output_semantic[loc] = slot_semantic;
}
if (!is_output_load && mask) {
/* Output stores. */
unsigned gs_streams = (uint32_t)nir_intrinsic_io_semantics(intr).gs_streams <<
@ -596,8 +587,6 @@ void si_nir_gather_info(struct si_screen *sscreen, struct nir_shader *nir,
*/
for (unsigned i = 0; i < ARRAY_SIZE(info->input_semantic); i++)
info->input_semantic[i] = NUM_TOTAL_VARYING_SLOTS;
for (unsigned i = 0; i < ARRAY_SIZE(info->output_semantic); i++)
info->output_semantic[i] = NUM_TOTAL_VARYING_SLOTS;
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
/* Both flat and non-flat can occur with nir_io_mix_convergent_flat_with_interpolated,
@ -676,14 +665,6 @@ void si_nir_gather_info(struct si_screen *sscreen, struct nir_shader *nir,
gather_instruction(nir, info, instr);
}
if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL) {
/* Add the PrimitiveID output, but don't increment num_outputs.
* The driver inserts PrimitiveID only when it's used by the pixel shader,
* and si_emit_spi_map uses this unconditionally when such a pixel shader is used.
*/
info->output_semantic[info->num_outputs] = VARYING_SLOT_PRIMITIVE_ID;
}
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
info->output_z_equals_input_z &= !info->output_z_is_not_input_z;
info->allow_flat_shading = !(info->uses_sysval_persp_center || info->uses_sysval_persp_centroid ||
@ -763,12 +744,6 @@ void si_nir_gather_info(struct si_screen *sscreen, struct nir_shader *nir,
assert(info->input_semantic[i] != NUM_TOTAL_VARYING_SLOTS &&
"nir_recompute_io_bases wasn't called");
}
if (nir->info.stage != MESA_SHADER_FRAGMENT) {
for (unsigned i = 0; i < info->num_outputs; i++) {
assert(info->output_semantic[i] != NUM_TOTAL_VARYING_SLOTS &&
"nir_recompute_io_bases wasn't called");
}
}
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
for (unsigned i = 0; i < info->num_inputs; i++) {

View file

@ -95,7 +95,6 @@ struct si_shader_info {
uint8_t num_inputs;
uint8_t num_outputs;
uint8_t input_semantic[PIPE_MAX_SHADER_INPUTS];
uint8_t output_semantic[PIPE_MAX_SHADER_OUTPUTS]; /* unset for FS */
uint8_t num_vs_inputs;
uint8_t num_vbos_in_user_sgprs;