+ case ir_binop_dot:
+ if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) {
+ this->progress = true;
+ return ir_constant::zero(mem_ctx, ir->type);
+ }
+ if (is_vec_basis(op_const[0])) {
+ this->progress = true;
+ unsigned component = 0;
+ for (unsigned c = 0; c < op_const[0]->type->vector_elements; c++) {
+ if (op_const[0]->value.f[c] == 1.0)
+ component = c;
+ }
+ return new(mem_ctx) ir_swizzle(ir->operands[1], component, 0, 0, 0, 1);
+ }
+ if (is_vec_basis(op_const[1])) {
+ this->progress = true;
+ unsigned component = 0;
+ for (unsigned c = 0; c < op_const[1]->type->vector_elements; c++) {
+ if (op_const[1]->value.f[c] == 1.0)
+ component = c;
+ }
+ return new(mem_ctx) ir_swizzle(ir->operands[0], component, 0, 0, 0, 1);
+ }
+ break;
+