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:
@@ -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 ) \
|
||||
|
@@ -44,13 +44,6 @@
|
||||
|
||||
|
||||
|
||||
static unsigned
|
||||
minify(unsigned d)
|
||||
{
|
||||
return MAX2(1, d>>1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cell_texture_layout(struct cell_texture *ct)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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:
|
||||
*/
|
||||
|
Reference in New Issue
Block a user