From: Michel Dänzer Date: Mon, 9 Apr 2007 12:52:18 +0000 (+0200) Subject: i915tex: Make sure texture format fetch hooks are initialized. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c96974f78cf3bbb94c01d6c84201595b4028d840;p=mesa.git i915tex: Make sure texture format fetch hooks are initialized. --- diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c index 22221e7322c..1ce663e994f 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c @@ -329,25 +329,7 @@ intelTexImage(GLcontext * ctx, texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat, format, type); - assert(texImage->TexFormat); - - switch (dims) { - case 1: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; - break; - case 2: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; - break; - case 3: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df; - break; - default: - assert(0); - break; - } + _mesa_set_fetch_functions(texImage, dims); if (texImage->TexFormat->TexelBytes == 0) { /* must be a compressed format */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index a570525155b..9b8a06df145 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2771,8 +2771,8 @@ fetch_texel_chan_to_float(const struct gl_texture_image *texImage, /** * Initialize the texture image's FetchTexelc and FetchTexelf methods. */ -static void -set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) +void +_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) { ASSERT(dims == 1 || dims == 2 || dims == 3); ASSERT(texImage->TexFormat); @@ -2832,7 +2832,7 @@ choose_texture_format(GLcontext *ctx, struct gl_texture_image *texImage, ASSERT(texImage->TexFormat); - set_fetch_functions(texImage, dims); + _mesa_set_fetch_functions(texImage, dims); if (texImage->TexFormat->TexelBytes == 0) { /* must be a compressed format */ diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index f67defc503f..da0c7cb78e5 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -85,6 +85,10 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, const struct gl_pixelstore_attrib *srcPacking); +extern void +_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); + + extern void _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat,