diff options
author | Kenneth Graunke <[email protected]> | 2010-09-07 23:16:26 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-09-08 12:09:41 -0700 |
commit | 84160a0454b17306e6b9bff5b6e50e54959c5680 (patch) | |
tree | c97c2cdc6995552d927bb6e13aa6011b9a2623d9 /src/glsl/builtins/ir/distance | |
parent | 961f42c9bd795204e031ea6a31a2ae04ba2e4067 (diff) |
glsl/builtins: Simplify degenerate scalar float cases.
The code being generated was just stupid, considering that:
- normalize(x) = 1.0
- length(x) = x
- distance(x, y) = x - y
Diffstat (limited to 'src/glsl/builtins/ir/distance')
-rw-r--r-- | src/glsl/builtins/ir/distance | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/glsl/builtins/ir/distance b/src/glsl/builtins/ir/distance index 1595bf669bb..f73f755b32b 100644 --- a/src/glsl/builtins/ir/distance +++ b/src/glsl/builtins/ir/distance @@ -3,9 +3,7 @@ (parameters (declare (in) float p0) (declare (in) float p1)) - ((declare () float p) - (assign (constant bool (1)) (x) (var_ref p) (expression float - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + ((return (expression float - (var_ref p0) (var_ref p1))))) (signature float (parameters |