summaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_instructions.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-06-14 23:13:27 -0700
committerKenneth Graunke <kenneth@whitecape.org>2011-06-29 16:07:13 -0700
commit578f6a9534ec6ea1ffc6638b98f0b5570a85a19d (patch)
tree1db15f9d850971be8588993ef8b60d2df0e1af79 /src/glsl/lower_instructions.cpp
parented92b912120394f3b19958effaa819d29bc6d059 (diff)
downloadexternal_mesa3d-578f6a9534ec6ea1ffc6638b98f0b5570a85a19d.zip
external_mesa3d-578f6a9534ec6ea1ffc6638b98f0b5570a85a19d.tar.gz
external_mesa3d-578f6a9534ec6ea1ffc6638b98f0b5570a85a19d.tar.bz2
glsl: Don't use MOD_TO_FRACT lowering on GLSL 1.30's % operator.
MOD_TO_FRACT was designed to lower the GLSL 1.20 mod() function, which operates on floating point values. However, we also use ir_binop_mod for GLSL 1.30's % operator, which operates on integers. For now, make MOD_TO_FRACT only apply to floating-point mod operations. In the future, we may want to add a lowering pass for integer-based mod. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/glsl/lower_instructions.cpp')
-rw-r--r--src/glsl/lower_instructions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/lower_instructions.cpp b/src/glsl/lower_instructions.cpp
index 94b8c4a..806f863 100644
--- a/src/glsl/lower_instructions.cpp
+++ b/src/glsl/lower_instructions.cpp
@@ -276,7 +276,7 @@ lower_instructions_visitor::visit_leave(ir_expression *ir)
break;
case ir_binop_mod:
- if (lowering(MOD_TO_FRACT))
+ if (lowering(MOD_TO_FRACT) && ir->type->is_float())
mod_to_fract(ir);
break;