glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).

This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
This commit is contained in:
Eric Anholt
2010-07-01 10:09:58 -07:00
parent 9acf618f24
commit 8a1f186cc5
8 changed files with 120 additions and 7 deletions

View File

@@ -1724,6 +1724,9 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
if (!state->error && !state->translation_unit.is_empty())
_mesa_ast_to_hir(shader->ir, state);
/* Lowering */
do_mod_to_fract(shader->ir);
/* Optimization passes */
if (!state->error && !shader->ir->is_empty()) {
bool progress;