gallium: Move minify() to u_math.

minify() is usually used in mipmap size calculation. Strangely enough,
we all defined it as MAX2(1, d >> 1); imagine that. :3
This commit is contained in:
Corbin Simpson
2009-08-07 20:16:39 -07:00
parent c58133b81a
commit 847fcb645c
6 changed files with 5 additions and 29 deletions

View File

@@ -450,6 +450,11 @@ align(int value, int alignment)
return (value + alignment - 1) & ~(alignment - 1);
}
static INLINE unsigned
minify(unsigned value)
{
return MAX2(1, value >> 1);
}
#ifndef COPY_4V
#define COPY_4V( DST, SRC ) \

View File

@@ -44,13 +44,6 @@
static unsigned
minify(unsigned d)
{
return MAX2(1, d>>1);
}
static void
cell_texture_layout(struct cell_texture *ct)
{

View File

@@ -72,11 +72,6 @@ static const int step_offsets[6][2] = {
{-1, 1}
};
static unsigned minify( unsigned d )
{
return MAX2(1, d>>1);
}
static unsigned
power_of_two(unsigned x)
{

View File

@@ -65,11 +65,6 @@ unsigned intel_compressed_alignment(unsigned internalFormat)
}
#endif
static unsigned minify( unsigned d )
{
return MAX2(1, d>>1);
}
static void intel_miptree_set_image_offset(struct brw_texture *tex,
unsigned level,

View File

@@ -22,13 +22,6 @@
#include "r300_texture.h"
/* XXX maths need to go to util */
static int minify(int i)
{
return MAX2(1, i >> 1);
}
static void r300_setup_texture_state(struct r300_texture* tex,
unsigned width,
unsigned height,

View File

@@ -48,11 +48,6 @@
/* Simple, maximally packed layout.
*/
static unsigned minify( unsigned d )
{
return MAX2(1, d>>1);
}
/* Conventional allocation path for non-display textures:
*/