diff options
author | Ian Romanick <[email protected]> | 2016-07-18 11:16:18 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-08-30 16:28:03 -0700 |
commit | dd574be54c5b6769a6a1a7d939759dc25b6b97bd (patch) | |
tree | e51a9eaeaf738f1f2c9c4a3b14fe6cbec5f8f225 /src/compiler/glsl/ir_expression_operation.py | |
parent | d6e73150a4017ace895472b049ca9381b1073a6d (diff) |
glsl: Refactor handling of horizontal operations
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Acked-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_expression_operation.py')
-rw-r--r-- | src/compiler/glsl/ir_expression_operation.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py index 8dfcf2c0397..d5a06f864eb 100644 --- a/src/compiler/glsl/ir_expression_operation.py +++ b/src/compiler/glsl/ir_expression_operation.py @@ -365,22 +365,21 @@ class operation(object): if self.c_expression is None: return None - if self.num_operands == 1: - if horizontal_operation in self.flags and non_assign_operation in self.flags: + if horizontal_operation in self.flags: + if non_assign_operation in self.flags: return constant_template_horizontal_nonassignment.render(op=self) - elif horizontal_operation in self.flags: + elif types_identical_operation in self.flags: + return constant_template_horizontal_single_implementation.render(op=self) + else: return constant_template_horizontal.render(op=self) - elif self.num_operands == 2: + + if self.num_operands == 2: if self.name == "mul": return constant_template_mul.render(op=self) elif self.name == "vector_extract": return constant_template_vector_extract.render(op=self) elif vector_scalar_operation in self.flags: return constant_template_vector_scalar.render(op=self) - elif horizontal_operation in self.flags and types_identical_operation in self.flags: - return constant_template_horizontal_single_implementation.render(op=self) - elif horizontal_operation in self.flags: - return constant_template_horizontal.render(op=self) elif self.num_operands == 3: if self.name == "vector_insert": return constant_template_vector_insert.render(op=self) |