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:
e50e1f8
)
gallium/util: fix u_bit_scan_consecutive_range for mask == 0xffffffff
author
Marek Olšák
<marek.olsak@amd.com>
Fri, 15 Apr 2016 20:08:57 +0000
(22:08 +0200)
committer
Marek Olšák
<marek.olsak@amd.com>
Mon, 18 Apr 2016 17:51:24 +0000
(19:51 +0200)
The second ffs returns 0, yielding count == -1.
v2: change 1 to 1u
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/auxiliary/util/u_math.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_math.h
b/src/gallium/auxiliary/util/u_math.h
index
b4ac0db
..
0a82915
100644
(file)
--- a/
src/gallium/auxiliary/util/u_math.h
+++ b/
src/gallium/auxiliary/util/u_math.h
@@
-518,9
+518,15
@@
u_bit_scan64(uint64_t *mask)
static inline void
u_bit_scan_consecutive_range(unsigned *mask, int *start, int *count)
{
+ if (*mask == 0xffffffff) {
+ *start = 0;
+ *count = 32;
+ *mask = 0;
+ return;
+ }
*start = ffs(*mask) - 1;
*count = ffs(~(*mask >> *start)) - 1;
- *mask &= ~(((1 << *count) - 1) << *start);
+ *mask &= ~(((1
u
<< *count) - 1) << *start);
}
/**