diff options
Diffstat (limited to 'src/mesa/main/macros.h')
-rw-r--r-- | src/mesa/main/macros.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index f6d38fb6480..b206acacf4a 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -656,6 +656,12 @@ INTERP_4F(GLfloat t, GLfloat dst[4], const GLfloat out[4], const GLfloat in[4]) #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C)) #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C)) +static inline unsigned +minify(unsigned value, unsigned levels) +{ + return MAX2(1, value >> levels); +} + /** * Align a value up to an alignment value * |