[Mesa-dev] [PATCH] ac/nir: move ac_declare_lds_as_pointer() outside of the switch
Bas Nieuwenhuizen
basni at chromium.org
Wed Feb 14 14:23:50 UTC 2018
On Wed, Feb 14, 2018 at 11:58 AM, Samuel Pitoiset <samuel.pitoiset at gmail.com
> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/amd/common/ac_nir_to_llvm.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_
> llvm.c
> index c7b07e16f8..4ec697aee4 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -1065,8 +1065,6 @@ static void create_function(struct
> radv_shader_context *ctx,
> set_loc_shader(ctx, AC_UD_VS_LS_TCS_IN_LAYOUT,
> &user_sgpr_idx, 1);
> }
> - if (ctx->options->key.vs.as_ls)
> - ac_declare_lds_as_pointer(&ctx->ac);
> break;
> case MESA_SHADER_TESS_CTRL:
> set_vs_specific_input_locs(ctx, stage, has_previous_stage,
> @@ -1077,7 +1075,6 @@ static void create_function(struct
> radv_shader_context *ctx,
> set_loc_shader(ctx, AC_UD_TCS_OFFCHIP_LAYOUT,
> &user_sgpr_idx, 4);
> if (ctx->abi.view_index)
> set_loc_shader(ctx, AC_UD_VIEW_INDEX,
> &user_sgpr_idx, 1);
> - ac_declare_lds_as_pointer(&ctx->ac);
> break;
> case MESA_SHADER_TESS_EVAL:
> set_loc_shader(ctx, AC_UD_TES_OFFCHIP_LAYOUT,
> &user_sgpr_idx, 1);
> @@ -1099,8 +1096,6 @@ static void create_function(struct
> radv_shader_context *ctx,
> &user_sgpr_idx, 2);
> if (ctx->abi.view_index)
> set_loc_shader(ctx, AC_UD_VIEW_INDEX,
> &user_sgpr_idx, 1);
> - if (has_previous_stage)
> - ac_declare_lds_as_pointer(&ctx->ac);
> break;
> case MESA_SHADER_FRAGMENT:
> if (ctx->shader_info->info.ps.needs_sample_positions) {
> @@ -1112,6 +1107,13 @@ static void create_function(struct
> radv_shader_context *ctx,
> unreachable("Shader stage not implemented");
> }
>
> + if (ctx->options->key.vs.as_ls ||
>
This is only valid when the shader is a vertex shader, as it is part of an
union.
> + stage == MESA_SHADER_TESS_CTRL ||
> + /* GFX9 has the ESGS ring buffer in LDS. */
> + (stage == MESA_SHADER_GEOMETRY && has_previous_stage)) {
> + ac_declare_lds_as_pointer(&ctx->ac);
> + }
> +
> ctx->shader_info->num_user_sgprs = user_sgpr_idx;
>
> #if 1
> --
> 2.16.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180214/5145ddc6/attachment.html>
More information about the mesa-dev
mailing list