mojoshader_compiler.c
changeset 958 02e7826c8c75
parent 945 f00ea3986db8
child 964 e8c09c28162e
--- a/mojoshader_compiler.c	Thu Nov 18 23:28:09 2010 -0500
+++ b/mojoshader_compiler.c	Mon Nov 22 13:24:04 2010 -0500
@@ -1504,11 +1504,8 @@
 
         case MOJOSHADER_AST_OP_MULTIPLY:
         case MOJOSHADER_AST_OP_DIVIDE:
-        case MOJOSHADER_AST_OP_MODULO:
         case MOJOSHADER_AST_OP_ADD:
         case MOJOSHADER_AST_OP_SUBTRACT:
-        case MOJOSHADER_AST_OP_LSHIFT:
-        case MOJOSHADER_AST_OP_RSHIFT:
             datatype = type_check_ast(ctx, ast->binary.left);
             datatype2 = type_check_ast(ctx, ast->binary.right);
             require_numeric_datatype(ctx, datatype);
@@ -1516,6 +1513,16 @@
             return add_type_coercion(ctx, &ast->binary.left, datatype,
                                      &ast->binary.right, datatype2);
 
+        case MOJOSHADER_AST_OP_LSHIFT:
+        case MOJOSHADER_AST_OP_RSHIFT:
+        case MOJOSHADER_AST_OP_MODULO:
+            datatype = type_check_ast(ctx, ast->binary.left);
+            datatype2 = type_check_ast(ctx, ast->binary.right);
+            require_integer_datatype(ctx, datatype);
+            require_integer_datatype(ctx, datatype2);
+            return add_type_coercion(ctx, &ast->binary.left, datatype,
+                                     &ast->binary.right, datatype2);
+
         case MOJOSHADER_AST_OP_LESSTHAN:
         case MOJOSHADER_AST_OP_GREATERTHAN:
         case MOJOSHADER_AST_OP_LESSTHANOREQUAL: