i915tex: Make sure texture format fetch hooks are initialized.
authorMichel Dänzer <michel@tungstengraphics.com>
Mon, 9 Apr 2007 12:52:18 +0000 (14:52 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Mon, 9 Apr 2007 12:53:41 +0000 (14:53 +0200)
src/mesa/drivers/dri/i915tex/intel_tex_image.c
src/mesa/main/texstore.c
src/mesa/main/texstore.h

index 22221e7322ce71a58d88fb252319f73ed5576016..1ce663e994f7a31c505540735aada53d34327364 100644 (file)
@@ -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 */
index a570525155bcf7484f3a647927abc3c3d59900cc..9b8a06df1452ff902f93c8b2ca76df28e39dfef2 100644 (file)
@@ -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 */
index f67defc503fcb7e62d05361fbfb2b22307ffeb7e..da0c7cb78e56550a9be2cf61cdf2a3aa727d4fbf 100644 (file)
@@ -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,