}
break;""")
-# This template is for unary operations that map an operand of one type to an
-# operand of another type. ir_unop_f2b is an example.
-constant_template2 = mako.template.Template("""\
- case ${op.get_enum_name()}:
- assert(op[0]->type->base_type == ${op.source_types[0].glsl_type});
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.${op.dest_type.union_field}[c] = ${op.get_c_expression(op.source_types)};
- break;""")
-
# This template is for binary operations that can operate on some combination
# of scalar and vector operands.
constant_template_vector_scalar = mako.template.Template("""\
return constant_template_horizontal_nonassignment.render(op=self)
elif horizontal_operation in self.flags:
return constant_template_horizontal_single_implementation.render(op=self)
- elif self.dest_type is not None and len(self.source_types) == 1:
- return constant_template2.render(op=self)
elif self.num_operands == 2:
if self.name == "mul":
return constant_template_mul.render(op=self)