OSDN Git Service
(root)
/
android-x86
/
external-mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83762af
)
glsl: Add "built-in" function to do ffloor(fp64)
author
Matt Turner
<mattst88@gmail.com>
Fri, 9 Nov 2018 05:59:42 +0000
(21:59 -0800)
committer
Matt Turner
<mattst88@gmail.com>
Thu, 10 Jan 2019 00:42:40 +0000
(16:42 -0800)
Reviewed-by: Elie Tournier <tournier.elie@gmail.com>
src/compiler/glsl/float64.glsl
patch
|
blob
|
history
diff --git
a/src/compiler/glsl/float64.glsl
b/src/compiler/glsl/float64.glsl
index
88ce0a7
..
c54835f
100644
(file)
--- a/
src/compiler/glsl/float64.glsl
+++ b/
src/compiler/glsl/float64.glsl
@@
-1385,6
+1385,19
@@
__ftrunc64(uint64_t __a)
}
uint64_t
+__ffloor64(uint64_t a)
+{
+ bool is_positive = __fge64(a, 0ul);
+ uint64_t tr = __ftrunc64(a);
+
+ if (is_positive || __feq64(tr, a)) {
+ return tr;
+ } else {
+ return __fadd64(tr, 0xbff0000000000000ul /* -1.0 */);
+ }
+}
+
+uint64_t
__fround64(uint64_t __a)
{
uvec2 a = unpackUint2x32(__a);