[Mesa-dev] Mesa IR as a list of instructions
Kenneth Graunke
kenneth at whitecape.org
Fri May 30 18:43:12 PDT 2014
On Wednesday, May 28, 2014 11:37:31 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?
>
> 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.
Patches 1-14 seem like nice cleanups, and get:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
I agree in principle with the change to use linked lists, but I haven't looked
at your code (and probably won't unless you really want me to). I'm not a
huge fan of simple_list, but you don't really have a better option currently,
so I'm not really objecting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140530/67959181/attachment.sig>
More information about the mesa-dev
mailing list