radeonsi: eliminate a not-found conditional for PrimID in si_get_ps_input_cntl
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12343>
This commit is contained in:
parent
3ea3621b8d
commit
5cdbbcc2ab
|
@ -483,6 +483,17 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
|
|||
scan_instruction(nir, info, instr);
|
||||
}
|
||||
|
||||
if (info->stage == MESA_SHADER_VERTEX || 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;
|
||||
info->output_semantic_to_slot[VARYING_SLOT_PRIMITIVE_ID] = info->num_outputs;
|
||||
info->output_type[info->num_outputs] = nir_type_uint32;
|
||||
info->output_usagemask[info->num_outputs] = 0x1;
|
||||
}
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
info->allow_flat_shading = !(info->uses_persp_center || info->uses_persp_centroid ||
|
||||
info->uses_persp_sample || info->uses_linear_center ||
|
||||
|
|
|
@ -3571,11 +3571,7 @@ static unsigned si_get_ps_input_cntl(struct si_context *sctx, struct si_shader *
|
|||
S_028644_ATTR1_VALID(!!(fp16_lo_hi_mask & 0x2));
|
||||
}
|
||||
} else {
|
||||
/* VS output not found. */
|
||||
if (semantic == VARYING_SLOT_PRIMITIVE_ID) {
|
||||
/* PrimID is written after the last output when HW VS is used. */
|
||||
ps_input_cntl |= S_028644_OFFSET(vs->info.vs_output_param_offset[vsinfo->num_outputs]);
|
||||
} else if (!G_028644_PT_SPRITE_TEX(ps_input_cntl)) {
|
||||
if (!G_028644_PT_SPRITE_TEX(ps_input_cntl)) {
|
||||
/* No corresponding output found, load defaults into input.
|
||||
* Don't set any other bits.
|
||||
* (FLAT_SHADE=1 completely changes behavior) */
|
||||
|
|
Loading…
Reference in New Issue