From ce82914f5ad4bb9148370826099925590e9798fd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 17 Sep 2011 14:50:48 -0600 Subject: mesa: move _mesa_update_fetch_functions() calls into swrast Do it during swrast state validation since the FetchTexel() functions are only called from swrast now and not core Mesa. Remove assertions in mipmap.c since they're no longer appropriate. --- src/mesa/swrast/s_context.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index df213357fae..963b7056be5 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -31,6 +31,7 @@ #include "main/colormac.h" #include "main/mtypes.h" #include "main/teximage.h" +#include "main/texfetch.h" #include "program/prog_parameter.h" #include "program/prog_statevars.h" #include "swrast.h" @@ -469,11 +470,14 @@ _swrast_update_texture_samplers(struct gl_context *ctx) return; /* pipe hack */ for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) { - const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current; + struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current; /* Note: If tObj is NULL, the sample function will be a simple * function that just returns opaque black (0,0,0,1). */ - swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj); + if (tObj) { + _mesa_update_fetch_functions(tObj); + swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj); + } } } -- cgit v1.2.3