glsl/standalone: Enable par-linking

If the user did not request full linking, link the shader with the
built-in functions, inline them, and eliminate them.  Previous to this
you'd see all these calls to "dot" and "max" in the output.  This
prevented a lot of expected optimizations and cluttered the output.
This gives it some chance of being useful.

v2: Rebase on top of Ken's "built-ins now" work.

v3: Don't do_common_optimizations if par-linking fails.  Update expected
output of warnings tests to prevent 'make check' regressions.

v4: Optimize harder.  Most important, do function inlining.  Otherwise
it's quite impractical for one function in a file to call another
function in the same file.

v5: Add some code simplifications and an assertion suggested by Iago.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
Ian Romanick
2016-09-15 11:24:12 -07:00
parent 4dc759c8c2
commit d0028b2e1c
4 changed files with 49 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
error: unresolved reference to function `fooFunction'

View File

@@ -1 +1,3 @@
0:11(14): warning: `willBeDefined' used uninitialized
error: unresolved reference to function `fooFunction'

View File

@@ -5,3 +5,5 @@
0:14(20): warning: `undefinedIndex' used uninitialized
0:14(51): warning: `undefinedIndex' used uninitialized
0:14(82): warning: `undefinedIndex' used uninitialized
error: unresolved reference to function `foo'