[Mesa-dev] [PATCH 11/12] i965: Create NIR during LinkShader() and ProgramStringNotify().

Ian Romanick idr at freedesktop.org
Wed Apr 8 15:46:05 PDT 2015


On 04/08/2015 01:46 PM, Jason Ekstrand wrote:
> On Wed, Apr 8, 2015 at 12:53 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> On 04/08/2015 02:25 AM, Martin Peres wrote:
>>> On 08/04/15 10:06, Kenneth Graunke wrote:
>>>> Previously, we translated into NIR and did all the optimizations and
>>>> lowering as part of running fs_visitor.  This meant that we did all of
>>>> that work twice for fragment shaders - once for SIMD8, and again for
>>>> SIMD16.  We also had to redo it every time we hit a state based
>>>> recompile.
>>>>
>>>> We now generate NIR once at link time.  ARB programs don't have linking,
>>>> so we instead generate it at ProgramStringNotify time.
>>>>
>>>> Mesa's fixed function vertex program handling doesn't bother to inform
>>>> the driver about new programs at all (which is rather mean), so we
>>>> generate NIR at the last minute, if it hasn't happened already.
>>>>
>>>> shader-db runs ~9.4% faster on my i7-5600U, with a release build.
>>>
>>> Nice speed improvement but wouldn't it affect negatively programs using
>>> SSO to recombine shaders at run time?
>>
>> Hm... that's a fair question.  Does NIR do any cross-stage optimization?
> 
> Not at the moment.  We probably should since NIR can probably
> dead-code things better.

Okay.  Then this shouldn't impact SSO.



More information about the mesa-dev mailing list