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

Matt Turner mattst88 at gmail.com
Tue Sep 23 12:25:05 PDT 2014


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>

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:

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