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

Ian Romanick idr at freedesktop.org
Wed May 28 12:02:09 PDT 2014

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.

It also feels a bit like a re-invention of TGSI, and nobody seems
particularly enamored with that IR either.

That said, it may still be an interesting experiment.

Patches 1 - 4 and 6 - 9 are

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

I need to look more closely at 5 and 10 - 16.

> This series fixes the first bullet point above.  Patch 15 is huge, but I
> didn't see a way to chop it up smaller without maintaining the list
> alongside the array for some intermediate patches.  I'd be willing to do
> so if needed, though, to make review doable.  You can also find the
> changes in the "mesa-ir" branch of my git tree.
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

More information about the mesa-dev mailing list