nir/opt_varyings: Allow optimizing primitive ID for MS -> FS.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28685>
This commit is contained in:
Timur Kristóf 2024-04-11 00:45:43 +02:00 committed by Marge Bot
parent 8792098772
commit 21ff2907c7

View file

@ -991,8 +991,9 @@ can_optimize_varying(struct linkage_info *linkage, gl_varying_slot location)
location == VARYING_SLOT_FOGC)
return options_var;
/* The primitive ID can always be optimized in GS -> FS. */
if (linkage->producer_stage == MESA_SHADER_GEOMETRY &&
/* The primitive ID can always be optimized in GS -> FS and MS -> FS. */
if ((linkage->producer_stage == MESA_SHADER_GEOMETRY ||
linkage->producer_stage == MESA_SHADER_MESH) &&
location == VARYING_SLOT_PRIMITIVE_ID)
return options_var;