glsl: Don't do structure splitting until link time.
authorEric Anholt <eric@anholt.net>
Wed, 7 Sep 2011 19:04:57 +0000 (12:04 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 9 Sep 2011 03:20:49 +0000 (20:20 -0700)
We were splitting on each side of an unlinked program, and the two
sides lost track of which variables they referenced, resulting in
assertion failure during validation.  Fixes piglit
link-struct-uniform-usage.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/glsl_parser_extras.cpp

index 8f740e6a8e93ae1ec0d04b49afc4e93eda6608e2..8faddc578d477f2feedfaadec89b6a8b8bef4d4b 100644 (file)
@@ -891,8 +891,8 @@ do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iteration
    if (linked) {
       progress = do_function_inlining(ir) || progress;
       progress = do_dead_functions(ir) || progress;
+      progress = do_structure_splitting(ir) || progress;
    }
-   progress = do_structure_splitting(ir) || progress;
    progress = do_if_simplification(ir) || progress;
    progress = do_discard_simplification(ir) || progress;
    progress = do_copy_propagation(ir) || progress;