[Mesa-dev] [PATCH 01/12] i965/fs: Manually generate the meta fast-clear shader

Kristian Høgsberg krh at bitplanet.net
Tue Sep 23 14:15:25 PDT 2014


On Tue, Sep 23, 2014 at 12:25 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Fri, Sep 19, 2014 at 1:10 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>> Previously, we were generating the fast-clear shader from GLSL.  The
>> problem is that fast clears require that we use a replicated write rather
>> than a regular write instruction.  In order to get this we had a
>> complicated and somewhat fragile optimization pass that looked for places
>> where we can use a replicated write and used it.  Since replicated writes
>> have a lot of restrictions, we only ever use them for fast-clear
>> operations.
>>
>> This commit replaces the optimization pass with a function that just
>> generates the shader we want.  This is a) less code, b) less fragile than
>> the optimization pass, and c) generates a more efficient shader.
>>
>> Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
>> Cc: Kristian Høgsberg <krh at bitplanet.net>

This looks great, way simpler than before and even a little better in
the MRT case.

> I think this is probably a good idea, and certainly simplifies things.
> It does prevent us from potentially recognizing other non-clear
> shaders after optimization though. I don't know all of the state
> requirements for using repdata so I don't think I can properly
> evaluate the benefit or difficulty in doing that. I'd defer to Ken --
> and pending other comments:

The old optimization pass was only enabled when we compiled the fast
clear shader, so it would only trigger in that case.  The rep write
message comes with restrictions on write masks and blending so it
would be a bit of work to make the optimization pass work in the
general case.  Either way, Jasons patch doesn't regress anything:

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> Reviewed-by: Matt Turner <mattst88 at gmail.com>
>
> Also, Cc'ing Kristian, who I don't think has seen this patch yet.


More information about the mesa-dev mailing list