mojoshader_compiler.c
changeset 958 02e7826c8c75
parent 945 f00ea3986db8
child 964 e8c09c28162e
equal deleted inserted replaced
957:c5992f4bee6d 958:02e7826c8c75
  1502             type_check_ast(ctx, ast->binary.left);
  1502             type_check_ast(ctx, ast->binary.left);
  1503             return type_check_ast(ctx, ast->binary.right);
  1503             return type_check_ast(ctx, ast->binary.right);
  1504 
  1504 
  1505         case MOJOSHADER_AST_OP_MULTIPLY:
  1505         case MOJOSHADER_AST_OP_MULTIPLY:
  1506         case MOJOSHADER_AST_OP_DIVIDE:
  1506         case MOJOSHADER_AST_OP_DIVIDE:
  1507         case MOJOSHADER_AST_OP_MODULO:
       
  1508         case MOJOSHADER_AST_OP_ADD:
  1507         case MOJOSHADER_AST_OP_ADD:
  1509         case MOJOSHADER_AST_OP_SUBTRACT:
  1508         case MOJOSHADER_AST_OP_SUBTRACT:
  1510         case MOJOSHADER_AST_OP_LSHIFT:
       
  1511         case MOJOSHADER_AST_OP_RSHIFT:
       
  1512             datatype = type_check_ast(ctx, ast->binary.left);
  1509             datatype = type_check_ast(ctx, ast->binary.left);
  1513             datatype2 = type_check_ast(ctx, ast->binary.right);
  1510             datatype2 = type_check_ast(ctx, ast->binary.right);
  1514             require_numeric_datatype(ctx, datatype);
  1511             require_numeric_datatype(ctx, datatype);
  1515             require_numeric_datatype(ctx, datatype2);
  1512             require_numeric_datatype(ctx, datatype2);
       
  1513             return add_type_coercion(ctx, &ast->binary.left, datatype,
       
  1514                                      &ast->binary.right, datatype2);
       
  1515 
       
  1516         case MOJOSHADER_AST_OP_LSHIFT:
       
  1517         case MOJOSHADER_AST_OP_RSHIFT:
       
  1518         case MOJOSHADER_AST_OP_MODULO:
       
  1519             datatype = type_check_ast(ctx, ast->binary.left);
       
  1520             datatype2 = type_check_ast(ctx, ast->binary.right);
       
  1521             require_integer_datatype(ctx, datatype);
       
  1522             require_integer_datatype(ctx, datatype2);
  1516             return add_type_coercion(ctx, &ast->binary.left, datatype,
  1523             return add_type_coercion(ctx, &ast->binary.left, datatype,
  1517                                      &ast->binary.right, datatype2);
  1524                                      &ast->binary.right, datatype2);
  1518 
  1525 
  1519         case MOJOSHADER_AST_OP_LESSTHAN:
  1526         case MOJOSHADER_AST_OP_LESSTHAN:
  1520         case MOJOSHADER_AST_OP_GREATERTHAN:
  1527         case MOJOSHADER_AST_OP_GREATERTHAN: