<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Dec 19, 2018 at 1:12 PM Alan Swanson <<a href="mailto:reiver@improbability.net">reiver@improbability.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 2018-12-17 at 16:16 +0000, Rhys Perry wrote:<br>
> Signed-off-by: Rhys Perry <<a href="mailto:pendingchaos02@gmail.com" target="_blank">pendingchaos02@gmail.com</a>><br>
> ---<br>
>  src/compiler/nir/nir_opt_peephole_select.c | 4 +++-<br>
>  1 file changed, 3 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/src/compiler/nir/nir_opt_peephole_select.c<br>
> b/src/compiler/nir/nir_opt_peephole_select.c<br>
> index ad9d0abec0..241627ed99 100644<br>
> --- a/src/compiler/nir/nir_opt_peephole_select.c<br>
> +++ b/src/compiler/nir/nir_opt_peephole_select.c<br>
> @@ -205,7 +205,9 @@ nir_opt_peephole_select_block(nir_block *block,<br>
> nir_shader *shader,<br>
>           break;<br>
>  <br>
>        nir_phi_instr *phi = nir_instr_as_phi(instr);<br>
> -      nir_alu_instr *sel = nir_alu_instr_create(shader,<br>
> nir_op_bcsel);<br>
> +      nir_op sel_op = nir_src_bit_size(if_stmt->condition) == 1 ?<br>
> +                      nir_op_bcsel : nir_op_b32csel;<br>
> +      nir_alu_instr *sel = nir_alu_instr_create(shader, sel_op);<br>
>        nir_src_copy(&sel->src[0].src, &if_stmt->condition, sel);<br>
>        /* Splat the condition to all channels */<br>
>        memset(sel->src[0].swizzle, 0, sizeof sel->src[0].swizzle);<br>
<br>
Just to note that I currently need this on radv with git head to run<br>
Total War: Warhammer 2 and probably other vulkan based games, else I<br>
get the following validation error (though it was suggested validator <br>
wouldn't complain in follow on emails);<br></blockquote><div><br></div><div>Yeah, I'm working on a more proper patch.  Unfortunately, I'm kind-of coding blind because I don't know and/or can't test radv very well. <br></div></div></div>