glsl2: Add pass for supporting variable vector indexing in rvalues.

The Mesa IR needs this to support vector indexing correctly, and
hardware backends such as 915 would want this behavior as well.

Fixes glsl-vs-vec4-indexing-2.
This commit is contained in:
Eric Anholt
2010-07-06 17:53:32 -07:00
parent 2d1789e667
commit a36334be02
5 changed files with 206 additions and 0 deletions

View File

@@ -1821,7 +1821,13 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
progress = do_dead_code_unlinked(state, shader->ir) || progress;
progress = do_constant_variable_unlinked(shader->ir) || progress;
progress = do_constant_folding(shader->ir) || progress;
progress = do_vec_index_to_swizzle(shader->ir) || progress;
/* Do this one after the previous to let the easier pass handle
* constant vector indexing.
*/
progress = do_vec_index_to_cond_assign(shader->ir) || progress;
progress = do_swizzle_swizzle(shader->ir) || progress;
} while (progress);
}