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 <samuel.pitoiset@gmail.com>
This commit is contained in:
Timothy Arceri
2017-05-20 13:54:20 +10:00
parent cf164d9e97
commit 3ceae88642

View File

@@ -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);
}