[Mesa-dev] Mesa IR as a list of instructions

Eric Anholt eric at anholt.net
Wed May 28 14:01:45 PDT 2014

Ian Romanick <idr at freedesktop.org> writes:

> On 05/28/2014 11:37 AM, Eric Anholt wrote:
>> Here's a series I started back in January as a little experiment.
>> Basically, I feel guilty for pushing GLSL IR into the driver, and wish I'd
>> just fixed up Mesa IR back in the day.  But, given that we're still
>> feeding Mesa IR into drivers as well (ARB programs and fixed function
>> vertex programs), it made me think: What if I fixed it up now, and got
>> Mesa IR to the point that we could just garbage collect the GLSL IR input
>> paths to drivers?
>> Mesa IR has a bunch of weaknesses that need to get sorted out if it's
>> going to be useful:
>> - It's a single giant array of instructions, making modifications of the
>>   instruction stream (instruction lowering, optimization, etc.) more
>>   expensive in code and CPU time than it should be.
>> - It doesn't have any variable declarations, so if you have dynamic array
>>   indexing, optimization just shuts down (plus, no annotation on the
>>   temps, so debugging is irritating).
>> - It doesn't have integer instructions or anything else post-GLSL-1.30.
>> - The optimization passes for it are totally ad-hoc and fairly weak.
>> - It's not SSA.
>> I'm interested in fixing all of these.  How do people feel about this
>> goal?
> I'm not very excited about exposing i915, r200, and swrast to more
> potential breakage that nobody will notice until 5 minutes before a
> release... or 5 mintues after.  Not wanting to touch prog_exec is one of
> the reasons we avoided making changes to Mesa IR in the first place.

I have tested this on i915 and swrast (well, OK, I didn't retest swrast
after the last set of changes to fix i915).

i915 was quite an adventure.  If you screw up the optimization, more
programs fall back to sw, and then piglit tests start passing (because
i915's floats are so imprecise that tests fail when run on hardware)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140528/8972007b/attachment.sig>

More information about the mesa-dev mailing list