-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Implement the transpose function only in webgl1
- Loading branch information
Showing
1 changed file
with
20 additions
and
18 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 |
---|---|---|
@@ -1,21 +1,23 @@ | ||
float transpose(float m) { | ||
return m; | ||
} | ||
#ifndef HILO_IS_WEBGL2 | ||
float transpose(float m) { | ||
return m; | ||
} | ||
|
||
mat2 transpose(mat2 m) { | ||
return mat2(m[0][0], m[1][0], | ||
m[0][1], m[1][1]); | ||
} | ||
mat2 transpose(mat2 m) { | ||
return mat2(m[0][0], m[1][0], | ||
m[0][1], m[1][1]); | ||
} | ||
|
||
mat3 transpose(mat3 m) { | ||
return mat3(m[0][0], m[1][0], m[2][0], | ||
m[0][1], m[1][1], m[2][1], | ||
m[0][2], m[1][2], m[2][2]); | ||
} | ||
mat3 transpose(mat3 m) { | ||
return mat3(m[0][0], m[1][0], m[2][0], | ||
m[0][1], m[1][1], m[2][1], | ||
m[0][2], m[1][2], m[2][2]); | ||
} | ||
|
||
mat4 transpose(mat4 m) { | ||
return mat4(m[0][0], m[1][0], m[2][0], m[3][0], | ||
m[0][1], m[1][1], m[2][1], m[3][1], | ||
m[0][2], m[1][2], m[2][2], m[3][2], | ||
m[0][3], m[1][3], m[2][3], m[3][3]); | ||
} | ||
mat4 transpose(mat4 m) { | ||
return mat4(m[0][0], m[1][0], m[2][0], m[3][0], | ||
m[0][1], m[1][1], m[2][1], m[3][1], | ||
m[0][2], m[1][2], m[2][2], m[3][2], | ||
m[0][3], m[1][3], m[2][3], m[3][3]); | ||
} | ||
#endif |