Re: [Mesa-dev] [PATCH] i965/fs: Optimize [-]b2f([!]gl_FrontFacing).

2015-01-16 Thread Jason Ekstrand
I meant to make this comment earlier but have been busy with other stuff. I like these optimizations in terms of the code they generate. Good work on figuring those out! That said, I'm a little pensive about adding more GLSL-IR-specific stuff to fs_visitor that we'll just have to rewrite for NIR.

[Mesa-dev] [PATCH] i965/fs: Optimize [-]b2f([!]gl_FrontFacing).

2015-01-15 Thread Matt Turner
The GLSL compiler optimizes the pattern result = [!]gl_FrontFacing ? x : y; where x and y are ±0.0 and ±1.0 into result = [-]b2f([!]gl_FrontFacing); We can do these expressions in two instructions. total instructions in shared programs: 5928518 -> 5927775 (-0.01%) instructions in affecte