aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-22 15:25:21 -0600
committerBrian Paul <[email protected]>2008-08-22 15:25:21 -0600
commit1a46dcc8a927dfb38ca1381e7b3dafb789f8257c (patch)
tree2f8fdae0e1e2858b73ca012f485777362792778e /src/gallium/drivers
parent1c2ff4d9e65563c071747a9c3bd907bd24706da0 (diff)
gallium: replace LOG2() macro with util_fast_log2() inline func
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c3
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 626c3a9d4e1..9b1313bc83e 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -33,6 +33,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_util.h"
+#include "util/u_math.h"
#include "sp_clear.h"
#include "sp_context.h"
#include "sp_flush.h"
@@ -128,6 +129,8 @@ softpipe_create( struct pipe_screen *screen,
struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
uint i;
+ util_init_math();
+
#ifdef PIPE_ARCH_X86
softpipe->use_sse = !debug_get_bool_option( "GALLIUM_NOSSE", FALSE );
#else
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 01f4d0ca811..d7680ffa81d 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -41,6 +41,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
#include "tgsi/tgsi_exec.h"
+#include "util/u_math.h"
/*
@@ -499,7 +500,7 @@ compute_lambda(struct tgsi_sampler *sampler,
rho = MAX2(rho, max);
}
- lambda = LOG2(rho);
+ lambda = util_fast_log2(rho);
lambda += lodbias + sampler->state->lod_bias;
lambda = CLAMP(lambda, sampler->state->min_lod, sampler->state->max_lod);