From 3ceae88642ddddf7c44b44df7b5c24ca0c7df878 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 20 May 2017 13:54:20 +1000 Subject: 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 --- src/compiler/glsl/ir.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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); } -- cgit v1.2.3