[Mesa-dev] [PATCH 3/3] radv: do not load unused gl_LocalInvocationID/gl_WorkGroupID components

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Dec 14 19:33:44 UTC 2017


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

for the series.

On Thu, Dec 14, 2017 at 4:48 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> We should also not load the input SGPRs and VGPRS, but
> let's start with this for now.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_shader.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
> index 4a3fdfa80e..907c1986f8 100644
> --- a/src/amd/vulkan/radv_shader.c
> +++ b/src/amd/vulkan/radv_shader.c
> @@ -392,13 +392,18 @@ radv_fill_shader_variant(struct radv_device *device,
>                 break;
>         case MESA_SHADER_FRAGMENT:
>                 break;
> -       case MESA_SHADER_COMPUTE:
> +       case MESA_SHADER_COMPUTE: {
> +               struct ac_shader_info *info = &variant->info.info;
>                 variant->rsrc2 |=
> -                       S_00B84C_TGID_X_EN(1) | S_00B84C_TGID_Y_EN(1) |
> -                       S_00B84C_TGID_Z_EN(1) | S_00B84C_TIDIG_COMP_CNT(2) |
> +                       S_00B84C_TGID_X_EN(info->cs.uses_block_id[0]) |
> +                       S_00B84C_TGID_Y_EN(info->cs.uses_block_id[1]) |
> +                       S_00B84C_TGID_Z_EN(info->cs.uses_block_id[2]) |
> +                       S_00B84C_TIDIG_COMP_CNT(info->cs.uses_thread_id[2] ? 2 :
> +                                               info->cs.uses_thread_id[1] ? 1 : 0) |
>                         S_00B84C_TG_SIZE_EN(1) |
>                         S_00B84C_LDS_SIZE(variant->config.lds_size);
>                 break;
> +       }
>         default:
>                 unreachable("unsupported shader type");
>                 break;
> --
> 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