Quote Originally Posted by bridgman View Post
I imagine there is a debug mechanism in Mesa to do that already, not sure though.
This 1 line patch by Marek prints out compiled shader programs, although I'm not actually sure if that is TGSI or something else like classic Mesa IR.

https://bugs.freedesktop.org/attachment.cgi?id=45557

Example output:
https://bugs.freedesktop.org/attachment.cgi?id=45560