diff options
author | Kenneth Graunke <[email protected]> | 2010-11-17 13:59:17 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-11-17 13:59:17 -0800 |
commit | 9935fe705df44bb633039ca74332cc0c126ccc30 (patch) | |
tree | 84b484f5f7a5fca90c05a84a7b28f4a6be0f64f7 /src/glsl | |
parent | af1cba2260c3546ba89d47c9612d66f513e69842 (diff) |
glsl: Remove the ir_binop_cross opcode.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ir.cpp | 2 | ||||
-rw-r--r-- | src/glsl/ir.h | 1 | ||||
-rw-r--r-- | src/glsl/ir_constant_expression.cpp | 20 | ||||
-rw-r--r-- | src/glsl/ir_validate.cpp | 6 |
4 files changed, 8 insertions, 21 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 4b886018dca..a7ebc0c2b66 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -252,7 +252,6 @@ ir_expression::get_num_operands(ir_expression_operation op) 2, /* ir_binop_logic_or */ 2, /* ir_binop_dot */ - 2, /* ir_binop_cross */ 2, /* ir_binop_min */ 2, /* ir_binop_max */ @@ -317,7 +316,6 @@ static const char *const operator_strs[] = { "^^", "||", "dot", - "cross", "min", "max", "pow", diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 6a70dede9b2..38ed2b23efb 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -771,7 +771,6 @@ enum ir_expression_operation { ir_binop_logic_or, ir_binop_dot, - ir_binop_cross, ir_binop_min, ir_binop_max, diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 740246897a4..8a54fc78cca 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -412,17 +412,6 @@ ir_expression::constant_expression_value() } break; - case ir_binop_cross: - assert(op[0]->type == glsl_type::vec3_type); - assert(op[1]->type == glsl_type::vec3_type); - data.f[0] = (op[0]->value.f[1] * op[1]->value.f[2] - - op[1]->value.f[1] * op[0]->value.f[2]); - data.f[1] = (op[0]->value.f[2] * op[1]->value.f[0] - - op[1]->value.f[2] * op[0]->value.f[0]); - data.f[2] = (op[0]->value.f[0] * op[1]->value.f[1] - - op[1]->value.f[0] * op[0]->value.f[1]); - break; - case ir_binop_add: assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar); for (unsigned c = 0, c0 = 0, c1 = 0; @@ -1064,7 +1053,14 @@ ir_call::constant_expression_value() for (unsigned c = 0; c < op[0]->type->components(); c++) data.f[c] = coshf(op[0]->value.f[c]); } else if (strcmp(callee, "cross") == 0) { - expr = new(mem_ctx) ir_expression(ir_binop_cross, type, op[0], op[1]); + assert(op[0]->type == glsl_type::vec3_type); + assert(op[1]->type == glsl_type::vec3_type); + data.f[0] = (op[0]->value.f[1] * op[1]->value.f[2] - + op[1]->value.f[1] * op[0]->value.f[2]); + data.f[1] = (op[0]->value.f[2] * op[1]->value.f[0] - + op[1]->value.f[2] * op[0]->value.f[0]); + data.f[2] = (op[0]->value.f[0] * op[1]->value.f[1] - + op[1]->value.f[0] * op[0]->value.f[1]); } else if (strcmp(callee, "degrees") == 0) { assert(op[0]->type->is_float()); for (unsigned c = 0; c < op[0]->type->components(); c++) diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index d22789f990a..77f48968b81 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -372,12 +372,6 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[0]->type->is_vector()); assert(ir->operands[0]->type == ir->operands[1]->type); break; - - case ir_binop_cross: - assert(ir->operands[0]->type == glsl_type::vec3_type); - assert(ir->operands[1]->type == glsl_type::vec3_type); - assert(ir->type == glsl_type::vec3_type); - break; } return visit_continue; |