From: Eric Anholt Date: Wed, 23 Jun 2010 21:33:30 +0000 (-0700) Subject: Avoid using the same ir_constant 0.0 multiple times in mat constructors. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02fc4b34e40f655eebc99f6502293b4d4000e0b3;p=mesa.git Avoid using the same ir_constant 0.0 multiple times in mat constructors. --- diff --git a/glsl_types.cpp b/glsl_types.cpp index 2b7c5bce30f..ca19de6bec3 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);