[Mesa-dev] [RFC] freedreno: add tgsi lowering pass

Rob Clark robdclark at gmail.com
Thu Jan 16 04:57:46 PST 2014


On Thu, Jan 16, 2014 at 4:51 AM, Marek Olšák <maraeo at gmail.com> wrote:
> On Thu, Jan 16, 2014 at 6:41 AM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Wed, Jan 15, 2014 at 5:40 AM, Rob Clark <robdclark at gmail.com> wrote:
>>> From: Rob Clark <robclark at freedesktop.org>
>>>
>>> So, as I found myself needing to lower a few more TGSI instructions,
>>> and noticing yet again that I would have to do the same lowering as
>>> various other gallium drivers already do,  I decided that maybe it
>>> makes sense to do this instead generically in a way that could maybe
>>> help other drivers too.
>>>
>>> This currently lowers the following instructions:
>>>
>>>    DST, XPD, SCS, LRP, FRC, POW, LIT, EXP, LOG
>>
>> I think we already have GLSL IR level lowering passes for lrp, pow,
>> exp, and log. Can't you use those?
>
> I guess he can, but the ARB programs as well as the fixed-function
> vertex program don't use the GLSL IR.

a lot of the oddball instructions seem to show up from ARB piglit
tests.. so sounds like using GLSL IR would not be too useful.  The
only other reasonable alternative that I saw was to build these
lowering directly into the tgsi generation directly, but seemed safer
/ less-intrusive to have it as a separate pass on the side.  And I
suppose doing it in GLSL IR -> TGSI would also not help for ARB or
fixed function shaders, I think?

Either way, I'm starting to play around with making a proper compiler
(ie. one that can actually do instruction scheduling and register
assignment), and getting rid of a ton of boring lowering code in my
compiler makes for less code to rewrite... which is a good thing.  I
don't mind keeping it in freedreno (since a few of the lowerings I
also need for a2xx as well as a3xx), but seems like it is something
that would probably be useful to other drivers too.

BR,
-R

> Marek


More information about the mesa-dev mailing list