[Mesa-dev] [PATCH] radv/gfx9: do not load VGPR1 when GS uses points or lines

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Jan 8 10:42:58 UTC 2018


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Fri, Jan 5, 2018 at 5:26 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> VGPR1 is only needed for topology that needs 3 offsets like
> triangles or quads.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_shader.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
> index 31879805ae..a8d263d817 100644
> --- a/src/amd/vulkan/radv_shader.c
> +++ b/src/amd/vulkan/radv_shader.c
> @@ -421,8 +421,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);
> --
> 2.15.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list