<div dir="ltr">I don't know exactly what's causing it, no. I noticed the issue was fixed on master so just bisected to this.<div><br></div><div>CC'ing stable to nominate:</div><div>42627dabb4db3011825a022325be7ae9b51103d6 - (1/3) ac: add if/loop build helpers </div><div>6e1a142863b368a032e333f09feb107241446053 - (2/3) radeonsi: make use of if/loop build helpers in ac</div><div>99cdc019bf6fe11c135b7544ef6daf4ac964fa24 - (3/3) ac: make use of if/loop build helpers<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 April 2018 at 10:45, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have no issue with these going in stable if they fix bugs. Ideally we should create a piglit test to catch this also but presumably you guys don't actually know the exact shader combination thats tripping things up?<div class="HOEnZb"><div class="h5"><br>
<br>
On 03/04/18 19:36, Samuel Pitoiset wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This fixes a rendering issue with Wolfenstein 2 as well. A backport sounds reasonable to me.<br>
<br>
On 04/03/2018 11:33 AM, Alex Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Timothy,<br>
<br>
This patch fixes some rendering issues I see with RADV on SI.<br>
<br>
It doesn't sound like it was really intended to fix anything, so possibly it's masking some other issue, but would you object to nominating the series for stable? Applying it on the 18.0 branch fixes the issue there as well.<br>
<br>
Thanks,<br>
Alex<br>
<br>
On 7 March 2018 at 20:43, Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a> <mailto:<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>>> wrote:<br>
<br>
For the series:<br>
<br>
Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a><br>
<mailto:<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>>><br>
<br>
Marek<br>
<br>
On Tue, Mar 6, 2018 at 8:40 PM, Timothy Arceri<br>
<<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a> <mailto:<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>><wbr>> wrote:<br>
> These helpers insert the basic block in the same order as they<br>
> appear in NIR making it easier to follow LLVM IR dumps. The helpers<br>
> also insert more useful labels onto the blocks.<br>
><br>
> TGSI use the line number of the corresponding opcode in the TGSI<br>
> dump as the label id, here we use the corresponding block index<br>
> from NIR.<br>
> ---<br>
> src/amd/common/ac_nir_to_llvm.<wbr>c | 60<br>
+++++++++++++-----------------<wbr>-----------<br>
> 1 file changed, 18 insertions(+), 42 deletions(-)<br>
><br>
> diff --git a/src/amd/common/ac_nir_to_llv<wbr>m.c<br>
b/src/amd/common/ac_nir_to_llv<wbr>m.c<br>
> index cda91fe8bf..dc463ed253 100644<br>
> --- a/src/amd/common/ac_nir_to_llv<wbr>m.c<br>
> +++ b/src/amd/common/ac_nir_to_llv<wbr>m.c<br>
> @@ -5237,17 +5237,15 @@ static void visit_ssa_undef(struct<br>
ac_nir_context *ctx,<br>
> _mesa_hash_table_insert(ctx-><wbr>defs, &instr->def, undef);<br>
> }<br>
><br>
> -static void visit_jump(struct ac_nir_context *ctx,<br>
> +static void visit_jump(struct ac_llvm_context *ctx,<br>
> const nir_jump_instr *instr)<br>
> {<br>
> switch (instr->type) {<br>
> case nir_jump_break:<br>
> - LLVMBuildBr(ctx->ac.builder, ctx->break_block);<br>
> - LLVMClearInsertionPosition(ct<wbr>x->ac.builder);<br>
> + ac_build_break(ctx);<br>
> break;<br>
> case nir_jump_continue:<br>
> - LLVMBuildBr(ctx->ac.builder, ctx->continue_block);<br>
> - LLVMClearInsertionPosition(ct<wbr>x->ac.builder);<br>
> + ac_build_continue(ctx);<br>
> break;<br>
> default:<br>
> fprintf(stderr, "Unknown NIR jump instr: ");<br>
> @@ -5285,7 +5283,7 @@ static void visit_block(struct<br>
ac_nir_context *ctx, nir_block *block)<br>
> visit_ssa_undef(ctx,<br>
nir_instr_as_ssa_undef(instr))<wbr>;<br>
> break;<br>
> case nir_instr_type_jump:<br>
> - visit_jump(ctx, nir_instr_as_jump(instr));<br>
> + visit_jump(&ctx->ac,<br>
nir_instr_as_jump(instr));<br>
> break;<br>
> default:<br>
> fprintf(stderr, "Unknown NIR instr type: ");<br>
> @@ -5302,56 +5300,34 @@ static void visit_if(struct<br>
ac_nir_context *ctx, nir_if *if_stmt)<br>
> {<br>
> LLVMValueRef value = get_src(ctx, if_stmt->condition);<br>
><br>
> - LLVMValueRef fn =<br>
LLVMGetBasicBlockParent(LLVMGe<wbr>tInsertBlock(ctx->ac.builder))<wbr>;<br>
> - LLVMBasicBlockRef merge_block =<br>
> - LLVMAppendBasicBlockInContext<wbr>(ctx->ac.context, fn, "");<br>
> - LLVMBasicBlockRef if_block =<br>
> - LLVMAppendBasicBlockInContext<wbr>(ctx->ac.context, fn, "");<br>
> - LLVMBasicBlockRef else_block = merge_block;<br>
> - if (!exec_list_is_empty(&if_stmt-<wbr>>else_list))<br>
> - else_block = LLVMAppendBasicBlockInContext(<br>
> - ctx->ac.context, fn, "");<br>
> -<br>
> - LLVMValueRef cond = LLVMBuildICmp(ctx->ac.builder,<br>
LLVMIntNE, value,<br>
> - ctx->ac.i32_0, "");<br>
> - LLVMBuildCondBr(ctx->ac.build<wbr>er, cond, if_block, else_block);<br>
> -<br>
> - LLVMPositionBuilderAtEnd(ctx-<wbr>>ac.builder, if_block);<br>
> + nir_block *then_block =<br>
> + (nir_block *)<br>
exec_list_get_head(&if_stmt->t<wbr>hen_list);<br>
> +<br>
> + ac_build_uif(&ctx->ac, value, then_block->index);<br>
> +<br>
> visit_cf_list(ctx, &if_stmt->then_list);<br>
> - if (LLVMGetInsertBlock(ctx->ac.bu<wbr>ilder))<br>
> - LLVMBuildBr(ctx->ac.builder, merge_block);<br>
><br>
> if (!exec_list_is_empty(&if_stmt-<wbr>>else_list)) {<br>
> - LLVMPositionBuilderAtEnd(ctx-<wbr>>ac.builder,<br>
else_block);<br>
> + nir_block *else_block =<br>
> + (nir_block *)<br>
exec_list_get_head(&if_stmt->e<wbr>lse_list);<br>
> +<br>
> + ac_build_else(&ctx->ac, else_block->index);<br>
> visit_cf_list(ctx, &if_stmt->else_list);<br>
> - if (LLVMGetInsertBlock(ctx->ac.bu<wbr>ilder))<br>
> - LLVMBuildBr(ctx->ac.builder, merge_block);<br>
> }<br>
><br>
> - LLVMPositionBuilderAtEnd(ctx-<wbr>>ac.builder, merge_block);<br>
> + ac_build_endif(&ctx->ac, then_block->index);<br>
> }<br>
><br>
> static void visit_loop(struct ac_nir_context *ctx, nir_loop *loop)<br>
> {<br>
> - LLVMValueRef fn =<br>
LLVMGetBasicBlockParent(LLVMGe<wbr>tInsertBlock(ctx->ac.builder))<wbr>;<br>
> - LLVMBasicBlockRef continue_parent = ctx->continue_block;<br>
> - LLVMBasicBlockRef break_parent = ctx->break_block;<br>
> + nir_block *first_loop_block =<br>
> + (nir_block *) exec_list_get_head(&loop->body<wbr>);<br>
><br>
> - ctx->continue_block =<br>
> - LLVMAppendBasicBlockInContext<wbr>(ctx->ac.context, fn, "");<br>
> - ctx->break_block =<br>
> - LLVMAppendBasicBlockInContext<wbr>(ctx->ac.context, fn, "");<br>
> + ac_build_bgnloop(&ctx->ac, first_loop_block->index);<br>
><br>
> - LLVMBuildBr(ctx->ac.builder, ctx->continue_block);<br>
> - LLVMPositionBuilderAtEnd(ctx-<wbr>>ac.builder,<br>
ctx->continue_block);<br>
> visit_cf_list(ctx, &loop->body);<br>
><br>
> - if (LLVMGetInsertBlock(ctx->ac.bu<wbr>ilder))<br>
> - LLVMBuildBr(ctx->ac.builder, ctx->continue_block);<br>
> - LLVMPositionBuilderAtEnd(ctx-<wbr>>ac.builder, ctx->break_block);<br>
> -<br>
> - ctx->continue_block = continue_parent;<br>
> - ctx->break_block = break_parent;<br>
> + ac_build_endloop(&ctx->ac, first_loop_block->index);<br>
> }<br>
><br>
> static void visit_cf_list(struct ac_nir_context *ctx,<br>
> --<br>
> 2.14.3<br>
><br>
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<mailto:<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedes<wbr>ktop.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>
<<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>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedes<wbr>ktop.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>
<<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>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
<br>
</blockquote></blockquote>
</div></div></blockquote></div><br></div>