summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-01 10:09:58 -0700
committerEric Anholt <[email protected]>2010-07-01 11:07:23 -0700
commit8a1f186cc55979bb9df0a88b48da8d81460c3e7c (patch)
tree7a39126f77b75f94c09f441fdbca6c2be57d34cb /src/mesa
parent9acf618f24428eba72650c0e328e7ed52986728e (diff)
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.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/ir_to_mesa.cpp3
1 files changed, 3 insertions, 0 deletions
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;