projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b63a1f8
)
glsl: Add "built-in" function to do abs(fp64)
author
Elie Tournier
<tournier.elie@gmail.com>
Tue, 8 Aug 2017 12:39:18 +0000
(13:39 +0100)
committer
Matt Turner
<mattst88@gmail.com>
Thu, 10 Jan 2019 00:42:40 +0000
(16:42 -0800)
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
src/compiler/glsl/float64.glsl
patch
|
blob
|
history
diff --git
a/src/compiler/glsl/float64.glsl
b/src/compiler/glsl/float64.glsl
index a299269677a6b154a8694aabda0c83eae9ed5bc8..28e3258e0fb6696f83eb0a3395d38c61d1773b2a 100644
(file)
--- a/
src/compiler/glsl/float64.glsl
+++ b/
src/compiler/glsl/float64.glsl
@@
-56,3
+56,14
@@
#define FLOAT_ROUND_DOWN 2
#define FLOAT_ROUND_UP 3
#define FLOAT_ROUNDING_MODE FLOAT_ROUND_NEAREST_EVEN
+
+/* Absolute value of a Float64 :
+ * Clear the sign bit
+ */
+uint64_t
+__fabs64(uint64_t __a)
+{
+ uvec2 a = unpackUint2x32(__a);
+ a.y &= 0x7FFFFFFFu;
+ return packUint2x32(a);
+}