summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/g3dvl/vl_util.c
blob: 50aa9af66f2684d7ae44b86e92f1e3ea089bc8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}