[Mesa-dev] [PATCH 00/17] Rework Mesa/ST shader compilation logic (Part 1)

Dave Airlie airlied at gmail.com
Tue Oct 6 16:25:53 PDT 2015


On 6 October 2015 at 11:26, Marek Olšák <maraeo at gmail.com> wrote:
> Hi,
>
> This is a start of reworking how st/mesa translates and creates shaders. The result of this patch series is this:
>
> In LinkShader or ProgramStringNotify, the shader is translated to TGSI as-is. There are no shader code modifications for shader variants. The glsl-to-tgsi visitor is released.
>
> We can't release the GLSL IR at this point yet, because core Mesa needs it for program resource queries at least.
>
> That's the only place st/mesa interacts with Mesa IR and GLSL IR. After that, it only works with the TGSI representation.
>
> When we get to a draw call, tgsi_transform_shader is used to modify shaders to produce shader variants. It does:
> - feature emulation (color clamping, per-sample shading, edgeflags)
> - adding glDrawPixels shader code
> - adding glBitmap shader code
>
> All the shader transformations are rewritten completely. There is no patching with Mesa IR or glsl-to-tgsi anymore.
>
> It shouldn't be so difficult to add support for some new IR or phase out Mesa IR and GLSL IR support at some point.
>
> The main motivations for this series are:
> - translate to TGSI as soon as possible
> - possibility to create gallium shaders after that if drivers don't need many variants
> - if variants are needed, the path to get them is much simpler
>

I'm happy where this stuff is going, I've looked over it for anything
really obviously wrong, but it seems sane enough for me
to at least be willing to debug in the future :-)

Reviewed-by: Dave Airlie <airlied at redhat.com>
for the series.

Dave.


More information about the mesa-dev mailing list