From 07d2c152bcb58ceb1626b15d664afd77ecbc4af4 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 30 Sep 2021 13:24:55 +0200 Subject: [PATCH] radv: make sure to load the Primitive ID for VS+GS as NGG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the VS doesn't export the Primitive ID but the FS needs it. Fixes dEQP-VK.pipeline.framebuffer_attachment.no_attachments*. Fixes: 7ad69e2f7ee ("radv: stop loading invocation ID for NGG vertex shaders") Signed-off-by: Samuel Pitoiset Reviewed-by: Timur Kristóf Part-of: --- src/amd/vulkan/radv_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 7d9e83a4bc0..a7c5a81c66d 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -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 */