Browse Source

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.
tags/mesa-8.0-rc1
Brian Paul 14 years ago
parent
commit
ce82914f5a

+ 0
- 4
src/mesa/main/mipmap.c View File

@@ -1955,8 +1955,6 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
dstDepth, border, srcImage->InternalFormat,
srcImage->TexFormat);
dstImage->DriverData = NULL;
dstImage->FetchTexelc = srcImage->FetchTexelc;
dstImage->FetchTexelf = srcImage->FetchTexelf;

/* Alloc new teximage data buffer */
{
@@ -1970,8 +1968,6 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
}

ASSERT(dstImage->TexFormat);
ASSERT(dstImage->FetchTexelc);
ASSERT(dstImage->FetchTexelf);

_mesa_generate_mipmap_level(target, datatype, comps, border,
srcWidth, srcHeight, srcDepth,

+ 1
- 6
src/mesa/main/teximage.c View File

@@ -42,7 +42,6 @@
#include "mfeatures.h"
#include "state.h"
#include "texcompress.h"
#include "texfetch.h"
#include "teximage.h"
#include "texstate.h"
#include "texpal.h"
@@ -1104,7 +1103,7 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
GLint border, GLenum internalFormat,
gl_format format)
{
GLint i, dims;
GLint i;

ASSERT(img);
ASSERT(width >= 0);
@@ -1176,10 +1175,6 @@ _mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
}

img->TexFormat = format;

dims = _mesa_get_texture_dimensions(target);

_mesa_set_fetch_functions(img, dims);
}



+ 0
- 1
src/mesa/main/texparam.c View File

@@ -432,7 +432,6 @@ set_tex_parameteri(struct gl_context *ctx,
if (texObj->Sampler.sRGBDecode != decode) {
flush(ctx);
texObj->Sampler.sRGBDecode = decode;
_mesa_update_fetch_functions(texObj);
}
return GL_TRUE;
}

+ 0
- 5
src/mesa/state_tracker/st_cb_texture.c View File

@@ -38,7 +38,6 @@
#include "main/pbo.h"
#include "main/pixeltransfer.h"
#include "main/texcompress.h"
#include "main/texfetch.h"
#include "main/texgetimage.h"
#include "main/teximage.h"
#include "main/texobj.h"
@@ -552,8 +551,6 @@ st_TexImage(struct gl_context * ctx,
stImage->base.Face = _mesa_tex_target_to_face(target);
stImage->base.Level = level;

_mesa_set_fetch_functions(texImage, dims);

/* Release the reference to a potentially orphaned buffer.
* Release any old malloced memory.
*/
@@ -975,8 +972,6 @@ st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,

dest = (GLubyte *) pixels;

_mesa_set_fetch_functions(texImage, get_texture_dims(target));

for (i = 0; i < depth; i++) {
if (compressed_dst) {
_mesa_get_compressed_teximage(ctx, target, level, dest,

+ 6
- 2
src/mesa/swrast/s_context.c View File

@@ -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);
}
}
}


Loading…
Cancel
Save