mesa/main: Add function to find next higher power of two.

With gcc implementation uses __builtin_clr which counts number of
leading zeros.

Fallback implementation uses bit manipulation. First it duplicates
the highest bit to all lower bits and then adds one to get the power
of two number.
1 file changed