Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / gallium / state_trackers / g3dvl / vl_util.c
1 #include "vl_util.h"
2 #include <assert.h>
3
4 unsigned int vlRoundUpPOT(unsigned int x)
5 {
6 unsigned int i;
7
8 assert(x > 0);
9
10 --x;
11
12 for (i = 1; i < sizeof(unsigned int) * 8; i <<= 1)
13 x |= x >> i;
14
15 return x + 1;
16 }