<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 14, 2018 at 11:58 AM, Samuel Pitoiset <span dir="ltr"><<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>><br>
---<br>
src/amd/common/ac_nir_to_llvm.<wbr>c | 12 +++++++-----<br>
1 file changed, 7 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/amd/common/ac_nir_to_<wbr>llvm.c b/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
index c7b07e16f8..4ec697aee4 100644<br>
--- a/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
+++ b/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
@@ -1065,8 +1065,6 @@ static void create_function(struct radv_shader_context *ctx,<br>
set_loc_shader(ctx, AC_UD_VS_LS_TCS_IN_LAYOUT,<br>
&user_sgpr_idx, 1);<br>
}<br>
- if (ctx->options->key.vs.as_ls)<br>
- ac_declare_lds_as_pointer(&<wbr>ctx->ac);<br>
break;<br>
case MESA_SHADER_TESS_CTRL:<br>
set_vs_specific_input_locs(<wbr>ctx, stage, has_previous_stage,<br>
@@ -1077,7 +1075,6 @@ static void create_function(struct radv_shader_context *ctx,<br>
set_loc_shader(ctx, AC_UD_TCS_OFFCHIP_LAYOUT, &user_sgpr_idx, 4);<br>
if (ctx->abi.view_index)<br>
set_loc_shader(ctx, AC_UD_VIEW_INDEX, &user_sgpr_idx, 1);<br>
- ac_declare_lds_as_pointer(&<wbr>ctx->ac);<br>
break;<br>
case MESA_SHADER_TESS_EVAL:<br>
set_loc_shader(ctx, AC_UD_TES_OFFCHIP_LAYOUT, &user_sgpr_idx, 1);<br>
@@ -1099,8 +1096,6 @@ static void create_function(struct radv_shader_context *ctx,<br>
&user_sgpr_idx, 2);<br>
if (ctx->abi.view_index)<br>
set_loc_shader(ctx, AC_UD_VIEW_INDEX, &user_sgpr_idx, 1);<br>
- if (has_previous_stage)<br>
- ac_declare_lds_as_pointer(&<wbr>ctx->ac);<br>
break;<br>
case MESA_SHADER_FRAGMENT:<br>
if (ctx->shader_info-><a href="http://info.ps">info.ps</a>.<wbr>needs_sample_positions) {<br>
@@ -1112,6 +1107,13 @@ static void create_function(struct radv_shader_context *ctx,<br>
unreachable("Shader stage not implemented");<br>
}<br>
<br>
+ if (ctx->options->key.vs.as_ls ||<br></blockquote><div><br></div><div>This is only valid when the shader is a vertex shader, as it is part of an union.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ stage == MESA_SHADER_TESS_CTRL ||<br>
+ /* GFX9 has the ESGS ring buffer in LDS. */<br>
+ (stage == MESA_SHADER_GEOMETRY && has_previous_stage)) {<br>
+ ac_declare_lds_as_pointer(&<wbr>ctx->ac);<br>
+ }<br>
+<br>
ctx->shader_info->num_user_<wbr>sgprs = user_sgpr_idx;<br>
<br>
#if 1<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.16.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>