diff options
author | Timothy Arceri <[email protected]> | 2017-05-20 13:54:20 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-22 14:21:55 +1000 |
commit | 3ceae88642ddddf7c44b44df7b5c24ca0c7df878 (patch) | |
tree | 20fa6c9d8006db79e43c30bd755263d86bbb68b4 | |
parent | cf164d9e975e2aa677b041c012cf843bd44e370a (diff) |
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 <[email protected]>
-rw-r--r-- | src/compiler/glsl/ir.cpp | 4 |
1 files changed, 1 insertions, 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); } |