[Mesa-dev] Comments on adding a GLSL_OPT_PASS macro and option in glsl_compiler_options

Thomas Helland thomashelland90 at gmail.com
Thu Sep 8 09:45:56 UTC 2016


Hi,

I have some old code lying around that I was considering picking up again.
The thought basically goes something like this:

Have a enum representing the compiler optimization passes in glsl.
Have an array of enums that define an optimization pass order.
Have a default array for glsl compiler options that can be overridden
by the backend if it wants to. Maybe add a NIR-like opt-macro.

My thinking is that this will make it easy for each backend to
decide what optimization passes it wants to run, and making it
easy to disable an optimization pass if the backend pleases.
This can allow us to possibly remove some overhead
by skipping passes that are deamed unnecessary.
It will also make it simpler to experiment with different orderings
of the optimization passes.

A future experiment I'm considering is hacking together
an automated script that reorders, compiles and runs shader-db.
One can then compare runtime, instruction count, etc,
and possibly find a golden combination that gives the best of both worlds.

What do people think about this? Will it be a viable project?

Regards,
Thomas


More information about the mesa-dev mailing list