summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-06-23 14:33:30 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-23 15:20:29 -0700
commit02fc4b34e40f655eebc99f6502293b4d4000e0b3 (patch)
tree3dbffbb865b4a696650a17310cfae1559e6a08de
parentbc1097d151677ace501a1f78c11e40ed5b80fdc6 (diff)
Avoid using the same ir_constant 0.0 multiple times in mat constructors.
-rw-r--r--glsl_types.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/glsl_types.cpp b/glsl_types.cpp
index 2b7c5bc..ca19de6 100644
--- a/glsl_types.cpp
+++ b/glsl_types.cpp
@@ -359,10 +359,9 @@ generate_mat_body_from_scalar(exec_list *instructions,
inst = new ir_assignment(lhs, rhs, NULL);
instructions->push_tail(inst);
- ir_constant *const zero = new ir_constant(0.0f);
-
for (unsigned i = 1; i < column_type->vector_elements; i++) {
ir_dereference *const lhs_ref = new ir_dereference_variable(column);
+ ir_constant *const zero = new ir_constant(0.0f);
ir_swizzle *lhs = new ir_swizzle(lhs_ref, i, 0, 0, 0, 1);