diff options
Diffstat (limited to 'src/gallium/state_trackers/g3dvl/vl_util.c')
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/g3dvl/vl_util.c b/src/gallium/state_trackers/g3dvl/vl_util.c new file mode 100644 index 0000000000..50aa9af66f --- /dev/null +++ b/src/gallium/state_trackers/g3dvl/vl_util.c @@ -0,0 +1,16 @@ +#include "vl_util.h" +#include <assert.h> + +unsigned int vlRoundUpPOT(unsigned int x) +{ + unsigned int i; + + assert(x > 0); + + --x; + + for (i = 1; i < sizeof(unsigned int) * 8; i <<= 1) + x |= x >> i; + + return x + 1; +} |