From 8a1f186cc55979bb9df0a88b48da8d81460c3e7c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Jul 2010 10:09:58 -0700 Subject: 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. --- src/mesa/shader/ir_to_mesa.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index 2f2096ef97b..25267d79b53 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -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; -- cgit v1.2.3