radv/gfx9: do not load VGPR1 when GS uses points or lines
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 5 Jan 2018 16:18:52 +0000 (17:18 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 8 Jan 2018 20:24:53 +0000 (21:24 +0100)
VGPR1 is only needed for topology that needs 3 offsets like
triangles or quads.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_shader.c

index 971d3abac913fa356efa56bf842f8e0ca1c6f7b0..5d777a05e586f9d8fbac27d0a5f605c930eeb3a6 100644 (file)
@@ -424,8 +424,10 @@ radv_fill_shader_variant(struct radv_device *device,
                        gs_vgpr_comp_cnt = 3; /* VGPR3 contains InvocationID. */
                else if (info->uses_prim_id)
                        gs_vgpr_comp_cnt = 2; /* VGPR2 contains PrimitiveID. */
+               else if (variant->info.gs.vertices_in >= 3)
+                       gs_vgpr_comp_cnt = 1; /* VGPR1 contains offsets 2, 3 */
                else
-                       gs_vgpr_comp_cnt = 1; /* TODO: use input_prim */
+                       gs_vgpr_comp_cnt = 0; /* VGPR0 contains offsets 0, 1 */
 
                /* TODO: Figure out how many we actually need. */
                variant->rsrc1 |= S_00B228_GS_VGPR_COMP_CNT(gs_vgpr_comp_cnt);