nir: Allow load_primitive_id in VS in nir_divergence_analysis.

The lowered NIR code of NGG VS shaders uses this intrinsic
when the VS has to export the primitive ID.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>
This commit is contained in:
Timur Kristóf 2021-05-10 22:37:46 +02:00 committed by Marge Bot
parent e905e0938a
commit 641707a807
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,7 @@ visit_intrinsic(nir_shader *shader, nir_intrinsic_instr *instr)
is_divergent = !(options & nir_divergence_single_patch_per_tcs_subgroup);
else if (stage == MESA_SHADER_TESS_EVAL)
is_divergent = !(options & nir_divergence_single_patch_per_tes_subgroup);
else if (stage == MESA_SHADER_GEOMETRY)
else if (stage == MESA_SHADER_GEOMETRY || stage == MESA_SHADER_VERTEX)
is_divergent = true;
else
unreachable("Invalid stage for load_primitive_id");