forked from hajimehoshi/ebiten
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shaderir: Bug fix: Implement atan2 for Metal correctly
Fixes hajimehoshi#1360
- Loading branch information
1 parent
a3634e1
commit 26768aa
Showing
5 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
void F0(float l0, float l1, thread bool& l2); | ||
|
||
void F0(float l0, float l1, thread bool& l2) { | ||
float l3 = float(0); | ||
float l4 = float(0); | ||
l3 = atan((l1) / (l0)); | ||
l4 = atan2(l1, l0); | ||
l2 = (l3) == (l4); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
void F0(in float l0, in float l1, out bool l2); | ||
|
||
void F0(in float l0, in float l1, out bool l2) { | ||
float l3 = float(0); | ||
float l4 = float(0); | ||
l3 = atan((l1) / (l0)); | ||
l4 = atan(l1, l0); | ||
l2 = (l3) == (l4); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
func Foo(x, y float) bool { | ||
a := atan(y / x) | ||
b := atan2(y, x) | ||
return a == b | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters