summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_function.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2017-09-18 15:30:51 -0500
committerIan Romanick <[email protected]>2017-10-02 14:46:02 -0700
commit6d1765c63aed1b814b29051c702f8e79ead6dbed (patch)
treecd8acdee3c4414b68c940bc6ab6e2f54369aa1b6 /src/compiler/glsl/ast_function.cpp
parent3cc997c7c81759446f4478d70252015fbe0ed9f5 (diff)
glsl: Don't pass NULL to ir_assignment constructor when not necessary
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_function.cpp')
-rw-r--r--src/compiler/glsl/ast_function.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index d528eccf313..46a61e46fd5 100644
--- a/src/compiler/glsl/ast_function.cpp
+++ b/src/compiler/glsl/ast_function.cpp
@@ -1128,7 +1128,7 @@ process_vec_mat_constructor(exec_list *instructions,
if (var->type->is_matrix()) {
ir_rvalue *lhs =
new(ctx) ir_dereference_array(var, new(ctx) ir_constant(i));
- assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
+ assignment = new(ctx) ir_assignment(lhs, rhs);
} else {
/* use writemask rather than index for vector */
assert(var->type->is_vector());
@@ -1264,7 +1264,7 @@ process_array_constructor(exec_list *instructions,
ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
new(ctx) ir_constant(i));
- ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
+ ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs);
instructions->push_tail(assignment);
i++;
@@ -1549,8 +1549,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_instruction *inst =
new(ctx) ir_assignment(new(ctx) ir_dereference_variable(rhs_var),
- new(ctx) ir_constant(rhs_var->type, &zero),
- NULL);
+ new(ctx) ir_constant(rhs_var->type, &zero));
instructions->push_tail(inst);
ir_dereference *const rhs_ref =
@@ -1583,7 +1582,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, rhs_swiz[i],
type->vector_elements);
- inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
+ inst = new(ctx) ir_assignment(col_ref, rhs);
instructions->push_tail(inst);
}
@@ -1596,7 +1595,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, 1, 1, 1, 1,
type->vector_elements);
- inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
+ inst = new(ctx) ir_assignment(col_ref, rhs);
instructions->push_tail(inst);
}
} else if (first_param->type->is_matrix()) {
@@ -1650,7 +1649,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_rvalue *const lhs =
new(ctx) ir_dereference_array(var, new(ctx) ir_constant(col));
- ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL);
+ ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs);
instructions->push_tail(inst);
}
}
@@ -1668,7 +1667,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_dereference *const rhs_var_ref =
new(ctx) ir_dereference_variable(rhs_var);
ir_instruction *const inst =
- new(ctx) ir_assignment(rhs_var_ref, first_param, NULL);
+ new(ctx) ir_assignment(rhs_var_ref, first_param);
instructions->push_tail(inst);
const unsigned last_row = MIN2(src_matrix->type->vector_elements,
@@ -1731,7 +1730,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
ir_dereference *rhs_var_ref =
new(ctx) ir_dereference_variable(rhs_var);
- ir_instruction *inst = new(ctx) ir_assignment(rhs_var_ref, rhs, NULL);
+ ir_instruction *inst = new(ctx) ir_assignment(rhs_var_ref, rhs);
instructions->push_tail(inst);
do {
@@ -1795,8 +1794,7 @@ emit_inline_record_constructor(const glsl_type *type,
ir_rvalue *const rhs = ((ir_instruction *) node)->as_rvalue();
assert(rhs != NULL);
- ir_instruction *const assign =
- new(mem_ctx) ir_assignment(lhs, rhs, NULL);
+ ir_instruction *const assign = new(mem_ctx) ir_assignment(lhs, rhs);
instructions->push_tail(assign);
node = node->next;
@@ -2158,7 +2156,7 @@ ast_function_expression::hir(exec_list *instructions,
instructions->push_tail(var);
instructions->push_tail(
new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
- matrix, NULL));
+ matrix));
var->constant_value = matrix->constant_expression_value(ctx);
/* Replace the matrix with dereferences of its columns. */