radv: make sure to load the Primitive ID for VS+GS as NGG

When the VS doesn't export the Primitive ID but the FS needs it.

Fixes dEQP-VK.pipeline.framebuffer_attachment.no_attachments*.

Fixes: 7ad69e2f7e ("radv: stop loading invocation ID for NGG vertex shaders")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13116>
This commit is contained in:
Samuel Pitoiset
2021-09-30 13:24:55 +02:00
committed by Marge Bot
parent ce2e2296ab
commit 07d2c152bc
+2 -1
View File
@@ -1303,7 +1303,8 @@ radv_postprocess_config(const struct radv_device *device, const struct ac_shader
stage == MESA_SHADER_TESS_EVAL && info->tes.primitive_mode >= 4; /* GL_TRIANGLES */
if (info->uses_invocation_id) {
gs_vgpr_comp_cnt = 3; /* VGPR3 contains InvocationID. */
} else if (info->uses_prim_id) {
} else if (info->uses_prim_id || (es_stage == MESA_SHADER_VERTEX &&
info->vs.outinfo.export_prim_id)) {
gs_vgpr_comp_cnt = 2; /* VGPR2 contains PrimitiveID. */
} else if (info->gs.vertices_in >= 3 || tes_triangles || nggc) {
gs_vgpr_comp_cnt = 1; /* VGPR1 contains offsets 2, 3 */