Implement prev_pow2 - will need this for 360 to round down texture

formats if passed value too large
This commit is contained in:
twinaphex 2012-11-21 20:47:20 +01:00
parent 8456464650
commit 52b46d9fd6

View File

@ -632,6 +632,16 @@ static inline uint32_t next_pow2(uint32_t v)
return v;
}
static inline uint32_t prev_pow2(uint32_t v)
{
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
return v - (v >> 1);
}
static inline uint8_t is_little_endian(void)
{
union