[Mesa-dev] [PATCH 5/5] i965/fs: Apply gl_FrontFacing ? -1 : 1 optimization only for floats
Ian Romanick
idr at freedesktop.org
Thu Mar 12 12:24:14 PDT 2015
On 03/11/2015 04:10 PM, Matt Turner wrote:
> On Wed, Mar 11, 2015 at 1:44 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> At the very least, unreal4/sun-temple/102.shader_test uses this pattern
>> for a signed integer result. However, that shader did not hit the
>> optimization in the first place because it uses !gl_FronFacing. I
>> changed the shader to use remove the logical-not and reverse the other
>> operands. I verified that incorrect code is generated before this
>> change and correct code is generated after.
>
> At one point I did have a patch that handled !gl_FrontFacing ? ... but
> I think it got lost.
I have a patch (somewhere) that converts (!b ? x : y) to (b ? y : x). I
think that would make explicit handling of !gl_FrontFacing unnecessary.
I also have some plan to add support for values other than +/-1.0. I
think other optimizations in my queue make other values occur.
> 4-5 are
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
More information about the mesa-dev
mailing list