summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_algebraic.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-01-05 22:42:31 -0800
committerKenneth Graunke <[email protected]>2014-01-07 12:54:57 -0800
commit5e3fd6a9dbd62ca5cd9965282fac01a34d23733e (patch)
tree6606b35cd8c5b1f3f4bd585b9b87db4323aa0c07 /src/glsl/opt_algebraic.cpp
parentd6c1d66d3a74e25435b5ebcde208e8049b669120 (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