ir_constant_expression: Remove support for dot products of integers.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 22 Jul 2010 01:18:16 +0000 (18:18 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 28 Jul 2010 22:46:28 +0000 (15:46 -0700)
This shouldn't be required since dot is only defined for floating point
types, even in GLSL 4.0.

src/glsl/ir_constant_expression.cpp

index cce13139b77361a72db9f49c250c69f2016a465a..799bd4a60b7b1bae3261c6533b920e8a6dce5e15 100644 (file)
@@ -327,21 +327,10 @@ ir_expression::constant_expression_value()
 
    case ir_binop_dot:
       assert(op[0]->type->is_vector() && op[1]->type->is_vector());
+      assert(op[0]->type->is_float() && op[1]->type->is_float());
       data.f[0] = 0;
       for (unsigned c = 0; c < op[0]->type->components(); c++) {
-        switch (op[0]->type->base_type) {
-        case GLSL_TYPE_UINT:
-           data.u[0] += op[0]->value.u[c] * op[1]->value.u[c];
-           break;
-        case GLSL_TYPE_INT:
-           data.i[0] += op[0]->value.i[c] * op[1]->value.i[c];
-           break;
-        case GLSL_TYPE_FLOAT:
-           data.f[0] += op[0]->value.f[c] * op[1]->value.f[c];
-           break;
-        default:
-           assert(0);
-        }
+        data.f[0] += op[0]->value.f[c] * op[1]->value.f[c];
       }
 
       break;