[Mesa-dev] [PATCH] nir: fix ir_binop_gequal glsl_to_nir conversion

Jason Ekstrand jason at jlekstrand.net
Sun Apr 15 00:30:06 UTC 2018


On April 14, 2018 12:43:35 Connor Abbott <cwabbott0 at gmail.com> wrote:

On Sat, Apr 14, 2018 at 3:39 PM, Erico Nunes <nunes.erico at gmail.com> wrote:
On Sat, Apr 14, 2018 at 9:26 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

What driver is hitting this path?  The !supports_ints path isn't used to my
knowledge so if some driver has started using it, they're liable to find
more bugs than just this one. :-)

I'm doing some work on the lima vertex shader compiler and I hit this.

And yeah this is there since 2015 it seems, so I suppose no other
drivers are using this path, we'll see if there's more.

I think that it's probably impractical to use this path, and we should
probably delete it. There are just too many optimizations, e.g. in
nir_opt_algebraic and lowering passes that assume you have ints. I
think a better plan would be to silently convert ints to floats in the
lima driver, and maybe inhibit any optimizations that use bit
twiddling tricks if real int support isn't indicated.

I'm not sure.  For quite a while prog_to_nir used these comparison 
operations so we know they more it less work.  For all I know, maybe it 
still does (I didn't actually check).  The only thing we need to worry 
about in terms of correctness is any optimizations in nir_opt_algebraic 
which consume only floats but produce integers.  Also, all drivers need to 
handle imov simply because it's easy.

That being said, we've done a lot of work to optimize the integer 
supporting paths so you may actually get better code if you can figure out 
a good way to lower the integers away.





More information about the mesa-dev mailing list