From: Timothy Arceri Date: Sat, 20 May 2017 03:54:20 +0000 (+1000) Subject: glsl: set mask via initialisation list rather than in constructor body X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ceae88642ddddf7c44b44df7b5c24ca0c7df878;p=mesa.git glsl: set mask via initialisation list rather than in constructor body Potentially more efficient as it may avoid the struct being initialised twice. Also add var to the initialisation list while we are here. Reviewed-by: Samuel Pitoiset --- diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp index 123de99005c..2d0c4c051ab 100644 --- a/src/compiler/glsl/ir.cpp +++ b/src/compiler/glsl/ir.cpp @@ -1590,10 +1590,8 @@ ir_swizzle::ir_swizzle(ir_rvalue *val, const unsigned *comp, } ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask) - : ir_rvalue(ir_type_swizzle) + : ir_rvalue(ir_type_swizzle), mask(mask), val(val) { - this->val = val; - this->mask = mask; this->type = glsl_type::get_instance(val->type->base_type, mask.num_components, 1); }