radeonsi: force flat for PrimID early in si_nir_scan_shader

Reviewed-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:
Marek Olšák 2021-08-11 00:12:05 -04:00 committed by Marge Bot
parent 5cdbbcc2ab
commit b59bb9c07a
2 changed files with 6 additions and 3 deletions

View File

@ -114,7 +114,11 @@ static void scan_io_usage(struct si_shader_info *info, nir_intrinsic_instr *intr
unsigned loc = driver_location + i;
info->input_semantic[loc] = semantic + i;
info->input_interpolate[loc] = interp;
if (semantic == SYSTEM_VALUE_PRIMITIVE_ID)
info->input_interpolate[loc] = INTERP_MODE_FLAT;
else
info->input_interpolate[loc] = interp;
if (mask) {
info->input_usage_mask[loc] |= mask;

View File

@ -3531,8 +3531,7 @@ static unsigned si_get_ps_input_cntl(struct si_context *sctx, struct si_shader *
unsigned offset, ps_input_cntl = 0;
if (interpolate == INTERP_MODE_FLAT ||
(interpolate == INTERP_MODE_COLOR && rs->flatshade) ||
semantic == VARYING_SLOT_PRIMITIVE_ID)
(interpolate == INTERP_MODE_COLOR && rs->flatshade))
ps_input_cntl |= S_028644_FLAT_SHADE(1);
if (semantic == VARYING_SLOT_PNTC ||