diff options
author | Younes Manton <younes.m@gmail.com> | 2008-07-03 20:05:32 -0400 |
---|---|---|
committer | Younes Manton <younes.m@gmail.com> | 2008-07-06 22:05:07 -0400 |
commit | 49937b99855984dd01a431c026f9308b6c0dac4f (patch) | |
tree | c43ec7af9a811565ce7c20c39d9db932ca3f35de /src/gallium/state_trackers/g3dvl/vl_util.c | |
parent | f99643ca6ea3aa05a0b16dc5d99e11fa00185684 (diff) |
g3dvl: Round surfaces up to POT, use src rect when outputting surfaces.
Diffstat (limited to 'src/gallium/state_trackers/g3dvl/vl_util.c')
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_util.c | 17 |
1 files changed, 17 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..2421ae2210 --- /dev/null +++ b/src/gallium/state_trackers/g3dvl/vl_util.c @@ -0,0 +1,17 @@ +#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; +} + |