[Mesa-dev] [PATCH] nir: create 32-bit bcsel for 32-bit conditions

Jason Ekstrand jason at jlekstrand.net
Wed Dec 19 19:33:46 UTC 2018


On Wed, Dec 19, 2018 at 1:12 PM Alan Swanson <reiver at improbability.net>
wrote:

> On Mon, 2018-12-17 at 16:16 +0000, Rhys Perry wrote:
> > Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
> > ---
> >  src/compiler/nir/nir_opt_peephole_select.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/compiler/nir/nir_opt_peephole_select.c
> > b/src/compiler/nir/nir_opt_peephole_select.c
> > index ad9d0abec0..241627ed99 100644
> > --- a/src/compiler/nir/nir_opt_peephole_select.c
> > +++ b/src/compiler/nir/nir_opt_peephole_select.c
> > @@ -205,7 +205,9 @@ nir_opt_peephole_select_block(nir_block *block,
> > nir_shader *shader,
> >           break;
> >
> >        nir_phi_instr *phi = nir_instr_as_phi(instr);
> > -      nir_alu_instr *sel = nir_alu_instr_create(shader,
> > nir_op_bcsel);
> > +      nir_op sel_op = nir_src_bit_size(if_stmt->condition) == 1 ?
> > +                      nir_op_bcsel : nir_op_b32csel;
> > +      nir_alu_instr *sel = nir_alu_instr_create(shader, sel_op);
> >        nir_src_copy(&sel->src[0].src, &if_stmt->condition, sel);
> >        /* Splat the condition to all channels */
> >        memset(sel->src[0].swizzle, 0, sizeof sel->src[0].swizzle);
>
> Just to note that I currently need this on radv with git head to run
> Total War: Warhammer 2 and probably other vulkan based games, else I
> get the following validation error (though it was suggested validator
> wouldn't complain in follow on emails);
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181219/f7656d1d/attachment.html>


More information about the mesa-dev mailing list