summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-01-19 15:07:52 -0800
committerKenneth Graunke <[email protected]>2016-01-22 21:03:00 -0800
commitae9f73ea40094fe3010b3a774595f72fe87a10db (patch)
tree7b3d7737141cd02f4013129bf84584f6be86a24d /src/glsl/builtin_functions.cpp
parent7ee89547533820eff3ff496dca10887cb2a8501b (diff)
glsl: Conditionalize atan2 math.
In the old hand-writen implementation of atan2, the calculation of atan(y/x) was performed conditionally in the "then" block of the outermost if statement. I believe I accidentally lifted this out into unconditional code when converting to IR builder. For reference, the original hand-written IR is visible in commit 722eff674b832e2321f791c68358ef52d2a1ff25. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: Erik Faye-Lund <[email protected]>
Diffstat (limited to 'src/glsl/builtin_functions.cpp')
-rw-r--r--src/glsl/builtin_functions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index f2e2165e8c3..95e86df1cdd 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -3267,7 +3267,7 @@ builtin_builder::_atan2(const glsl_type *type)
ir_factory outer_then(&outer_if->then_instructions, mem_ctx);
/* Then...call atan(y/x) */
- do_atan(body, glsl_type::float_type, r, div(y, x));
+ do_atan(outer_then, glsl_type::float_type, r, div(y, x));
/* ...and fix it up: */
ir_if *inner_if = new(mem_ctx) ir_if(less(x, imm(0.0f)));