glsl: Add unary ir_expression constructor
This commit is contained in:
@@ -191,9 +191,22 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ir_expression::ir_expression(int op, const struct glsl_type *type,
|
||||||
|
ir_rvalue *op0)
|
||||||
|
{
|
||||||
|
assert(get_num_operands(ir_expression_operation(op)) == 1);
|
||||||
|
this->ir_type = ir_type_expression;
|
||||||
|
this->type = type;
|
||||||
|
this->operation = ir_expression_operation(op);
|
||||||
|
this->operands[0] = op0;
|
||||||
|
this->operands[1] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ir_expression::ir_expression(int op, const struct glsl_type *type,
|
ir_expression::ir_expression(int op, const struct glsl_type *type,
|
||||||
ir_rvalue *op0, ir_rvalue *op1)
|
ir_rvalue *op0, ir_rvalue *op1)
|
||||||
{
|
{
|
||||||
|
assert((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1)
|
||||||
|
|| (get_num_operands(ir_expression_operation(op)) == 2));
|
||||||
this->ir_type = ir_type_expression;
|
this->ir_type = ir_type_expression;
|
||||||
this->type = type;
|
this->type = type;
|
||||||
this->operation = ir_expression_operation(op);
|
this->operation = ir_expression_operation(op);
|
||||||
|
@@ -832,6 +832,14 @@ enum ir_expression_operation {
|
|||||||
|
|
||||||
class ir_expression : public ir_rvalue {
|
class ir_expression : public ir_rvalue {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Constructor for unary operation expressions
|
||||||
|
*/
|
||||||
|
ir_expression(int op, const struct glsl_type *type, ir_rvalue *);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for binary operation expressions
|
||||||
|
*/
|
||||||
ir_expression(int op, const struct glsl_type *type,
|
ir_expression(int op, const struct glsl_type *type,
|
||||||
ir_rvalue *, ir_rvalue *);
|
ir_rvalue *, ir_rvalue *);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user