diff options
author | Kenneth Graunke <[email protected]> | 2014-01-05 22:42:31 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-01-07 12:54:57 -0800 |
commit | 5e3fd6a9dbd62ca5cd9965282fac01a34d23733e (patch) | |
tree | 6606b35cd8c5b1f3f4bd585b9b87db4323aa0c07 /src/glsl/opt_algebraic.cpp | |
parent | d6c1d66d3a74e25435b5ebcde208e8049b669120 (diff) |
glsl: Refactor is_zero/one/negative_one into an is_value() method.
This patch creates a new generic is_value() method, which checks if an
ir_constant has a particular value. (For vectors, it must have the
single value repeated across all components.)
It then rewrites the is_zero/is_one/is_negative_one methods to use this
generic helper. All three were basically identical except for the value
they checked for. The other difference is that is_negative_one rejects
boolean types. The new is_value function maintains this behavior, only
allowing boolean types when checking for 0 or 1.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/opt_algebraic.cpp')
0 files changed, 0 insertions, 0 deletions