mesa: consolidate internal glTexImage1/2/3D code
authorBrian Paul <brianp@vmware.com>
Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 6 Jun 2012 13:55:59 +0000 (07:55 -0600)
The functions for handling 1D, 2D and 3D texture images were nearly
identical.  This folds them all together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/common/driverfuncs.c
src/mesa/drivers/dri/intel/intel_tex_image.c
src/mesa/drivers/dri/nouveau/nouveau_texture.c
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/main/dd.h
src/mesa/main/teximage.c
src/mesa/main/texobj.c
src/mesa/main/texstore.c
src/mesa/main/texstore.h
src/mesa/state_tracker/st_cb_texture.c

index ca120578da976b05b8d79f952b16a0946cef6bc1..54e5221b28b334021953442d30bbbfee235a377a 100644 (file)
@@ -91,9 +91,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 
    /* Texture functions */
    driver->ChooseTextureFormat = _mesa_choose_tex_format;
-   driver->TexImage1D = _mesa_store_teximage1d;
-   driver->TexImage2D = _mesa_store_teximage2d;
-   driver->TexImage3D = _mesa_store_teximage3d;
+   driver->TexImage = _mesa_store_teximage;
    driver->TexSubImage1D = _mesa_store_texsubimage1d;
    driver->TexSubImage2D = _mesa_store_texsubimage2d;
    driver->TexSubImage3D = _mesa_store_texsubimage3d;
index abd75c51d29c327f206333252e66d249f348b6e6..6e7e7018182492cf87e0d3f6978a335d16675c53 100644 (file)
@@ -203,13 +203,12 @@ try_pbo_upload(struct gl_context *ctx,
 
 static void
 intelTexImage(struct gl_context * ctx,
-              GLint dims,
+              GLuint dims,
               struct gl_texture_image *texImage,
               GLint internalFormat,
-              GLint width, GLint height, GLint depth,
+              GLint width, GLint height, GLint depth, GLint border,
               GLenum format, GLenum type, const void *pixels,
-              const struct gl_pixelstore_attrib *unpack,
-              GLsizei imageSize)
+              const struct gl_pixelstore_attrib *unpack)
 {
    DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
        _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
@@ -226,52 +225,9 @@ intelTexImage(struct gl_context * ctx,
    DBG("%s: upload image %dx%dx%d pixels %p\n",
        __FUNCTION__, width, height, depth, pixels);
 
-   _mesa_store_teximage3d(ctx, texImage, internalFormat,
-                         width, height, depth, 0,
-                         format, type, pixels, unpack);
-}
-
-
-static void
-intelTexImage3D(struct gl_context * ctx,
-                struct gl_texture_image *texImage,
-                GLint internalFormat,
-                GLint width, GLint height, GLint depth,
-                GLint border,
-                GLenum format, GLenum type, const void *pixels,
-                const struct gl_pixelstore_attrib *unpack)
-{
-   intelTexImage(ctx, 3, texImage,
-                 internalFormat, width, height, depth,
-                 format, type, pixels, unpack, 0);
-}
-
-
-static void
-intelTexImage2D(struct gl_context * ctx,
-                struct gl_texture_image *texImage,
-                GLint internalFormat,
-                GLint width, GLint height, GLint border,
-                GLenum format, GLenum type, const void *pixels,
-                const struct gl_pixelstore_attrib *unpack)
-{
-   intelTexImage(ctx, 2, texImage,
-                 internalFormat, width, height, 1,
-                 format, type, pixels, unpack, 0);
-}
-
-
-static void
-intelTexImage1D(struct gl_context * ctx,
-                struct gl_texture_image *texImage,
-                GLint internalFormat,
-                GLint width, GLint border,
-                GLenum format, GLenum type, const void *pixels,
-                const struct gl_pixelstore_attrib *unpack)
-{
-   intelTexImage(ctx, 1, texImage,
-                 internalFormat, width, 1, 1,
-                 format, type, pixels, unpack, 0);
+   _mesa_store_teximage(ctx, dims, texImage, internalFormat,
+                        width, height, depth, 0,
+                        format, type, pixels, unpack);
 }
 
 
@@ -398,9 +354,7 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
 void
 intelInitTextureImageFuncs(struct dd_function_table *functions)
 {
-   functions->TexImage1D = intelTexImage1D;
-   functions->TexImage2D = intelTexImage2D;
-   functions->TexImage3D = intelTexImage3D;
+   functions->TexImage = intelTexImage;
 
 #if FEATURE_OES_EGL_image
    functions->EGLImageTargetTexture2D = intel_image_target_texture_2d;
index a2e96aa168449be3aeb723df5197811dfebfd4fd..e5ef3d3ff9ffee15f0021bf18ec661fff580b766 100644 (file)
@@ -540,41 +540,16 @@ nouveau_teximage(struct gl_context *ctx, GLint dims,
        context_dirty_i(ctx, TEX_ENV, ctx->Texture.CurrentUnit);
 }
 
-static void
-nouveau_teximage_1d(struct gl_context *ctx,
-                   struct gl_texture_image *ti,
-                   GLint internalFormat,
-                   GLint width, GLint border,
-                   GLenum format, GLenum type, const GLvoid *pixels,
-                   const struct gl_pixelstore_attrib *packing)
-{
-       nouveau_teximage(ctx, 1, ti, internalFormat,
-                        width, 1, 1, border, 0, format, type, pixels,
-                        packing, GL_FALSE);
-}
 
 static void
-nouveau_teximage_2d(struct gl_context *ctx,
-                   struct gl_texture_image *ti,
-                   GLint internalFormat,
-                   GLint width, GLint height, GLint border,
-                   GLenum format, GLenum type, const GLvoid *pixels,
-                   const struct gl_pixelstore_attrib *packing)
-{
-       nouveau_teximage(ctx, 2, ti, internalFormat,
-                        width, height, 1, border, 0, format, type, pixels,
-                        packing, GL_FALSE);
-}
-
-static void
-nouveau_teximage_3d(struct gl_context *ctx,
-                   struct gl_texture_image *ti,
-                   GLint internalFormat,
-                   GLint width, GLint height, GLint depth, GLint border,
-                   GLenum format, GLenum type, const GLvoid *pixels,
-                   const struct gl_pixelstore_attrib *packing)
+nouveau_teximage_123d(struct gl_context *ctx, GLuint dims,
+                      struct gl_texture_image *ti,
+                      GLint internalFormat,
+                      GLint width, GLint height, GLint depth, GLint border,
+                      GLenum format, GLenum type, const GLvoid *pixels,
+                      const struct gl_pixelstore_attrib *packing)
 {
-       nouveau_teximage(ctx, 3, ti, internalFormat,
+       nouveau_teximage(ctx, dims, ti, internalFormat,
                         width, height, depth, border, 0, format, type, pixels,
                         packing, GL_FALSE);
 }
@@ -756,9 +731,7 @@ nouveau_texture_functions_init(struct dd_function_table *functions)
        functions->NewTextureImage = nouveau_teximage_new;
        functions->FreeTextureImageBuffer = nouveau_teximage_free;
        functions->ChooseTextureFormat = nouveau_choose_tex_format;
-       functions->TexImage1D = nouveau_teximage_1d;
-       functions->TexImage2D = nouveau_teximage_2d;
-       functions->TexImage3D = nouveau_teximage_3d;
+       functions->TexImage = nouveau_teximage_123d;
        functions->TexSubImage1D = nouveau_texsubimage_1d;
        functions->TexSubImage2D = nouveau_texsubimage_2d;
        functions->TexSubImage3D = nouveau_texsubimage_3d;
index ccb9956a8e630fbeb7070e621fa5ed73223ae1ff..8df5484f55713c2e614a0bd195c6bc6867c1a8d5 100644 (file)
@@ -586,39 +586,14 @@ static void radeon_teximage(
        const struct gl_pixelstore_attrib *packing,
        int compressed)
 {
-       _mesa_store_teximage3d(ctx, texImage, internalFormat,
-                              width, height, depth, 0,
-                              format, type, pixels,
-                              packing);
+       _mesa_store_teximage(ctx, dims, texImage, internalFormat,
+                            width, height, depth, 0,
+                            format, type, pixels,
+                            packing);
 }
 
 static void
-radeonTexImage1D(struct gl_context * ctx,
-                     struct gl_texture_image *texImage,
-                     GLint internalFormat,
-                     GLint width, GLint border,
-                     GLenum format, GLenum type, const GLvoid * pixels,
-                     const struct gl_pixelstore_attrib *packing)
-{
-       radeon_teximage(ctx, 1, texImage, internalFormat, width, 1, 1,
-               0, format, type, pixels, packing, 0);
-}
-
-static void
-radeonTexImage2D(struct gl_context * ctx,
-                     struct gl_texture_image *texImage,
-                     GLint internalFormat,
-                     GLint width, GLint height, GLint border,
-                     GLenum format, GLenum type, const GLvoid * pixels,
-                     const struct gl_pixelstore_attrib *packing)
-
-{
-       radeon_teximage(ctx, 2, texImage, internalFormat, width, height, 1,
-               0, format, type, pixels, packing, 0);
-}
-
-static void
-radeonTexImage3D(struct gl_context * ctx,
+radeonTexImage(struct gl_context * ctx, GLuint dims,
                      struct gl_texture_image *texImage,
                      GLint internalFormat,
                      GLint width, GLint height, GLint depth,
@@ -626,7 +601,7 @@ radeonTexImage3D(struct gl_context * ctx,
                      GLenum format, GLenum type, const GLvoid * pixels,
                      const struct gl_pixelstore_attrib *packing)
 {
-       radeon_teximage(ctx, 3, texImage, internalFormat, width, height, depth,
+       radeon_teximage(ctx, dims, texImage, internalFormat, width, height, depth,
                0, format, type, pixels, packing, 0);
 }
 
@@ -750,9 +725,7 @@ radeon_init_common_texture_funcs(radeonContextPtr radeon,
 
        functions->ChooseTextureFormat  = radeonChooseTextureFormat_mesa;
 
-       functions->TexImage1D = radeonTexImage1D;
-       functions->TexImage2D = radeonTexImage2D;
-       functions->TexImage3D = radeonTexImage3D;
+       functions->TexImage = radeonTexImage;
 
        functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
 
index 582eb5d492be7f1f67358fb03bd0cdf387007e07..711143c5594808318dd586fa08df5dfe9e2d5dda 100644 (file)
@@ -198,43 +198,21 @@ struct dd_function_table {
                                      GLenum srcFormat, GLenum srcType );
 
    /**
-    * Called by glTexImage1D().  Simply copy the source texture data into the
-    * destination texture memory.  The gl_texture_image fields, etc. will be
-    * fully initialized.
-    * The parameters are the same as glTexImage1D(), plus:
+    * Called by glTexImage[123]D() and glCopyTexImage[12]D()
+    * Allocate texture memory and copy the user's image to the buffer.
+    * The gl_texture_image fields, etc. will be fully initialized.
+    * The parameters are the same as glTexImage3D(), plus:
+    * \param dims  1, 2, or 3 indicating glTexImage1/2/3D()
     * \param packing describes how to unpack the source data.
     * \param texImage is the destination texture image.
     */
-   void (*TexImage1D)(struct gl_context *ctx,
-                      struct gl_texture_image *texImage,
-                      GLint internalFormat,
-                      GLint width, GLint border,
-                      GLenum format, GLenum type, const GLvoid *pixels,
-                      const struct gl_pixelstore_attrib *packing);
+   void (*TexImage)(struct gl_context *ctx, GLuint dims,
+                    struct gl_texture_image *texImage,
+                    GLint internalFormat,
+                    GLint width, GLint height, GLint depth, GLint border,
+                    GLenum format, GLenum type, const GLvoid *pixels,
+                    const struct gl_pixelstore_attrib *packing);
 
-   /**
-    * Called by glTexImage2D().
-    * 
-    * \sa dd_function_table::TexImage1D.
-    */
-   void (*TexImage2D)(struct gl_context *ctx,
-                      struct gl_texture_image *texImage,
-                      GLint internalFormat,
-                      GLint width, GLint height, GLint border,
-                      GLenum format, GLenum type, const GLvoid *pixels,
-                      const struct gl_pixelstore_attrib *packing);
-   
-   /**
-    * Called by glTexImage3D().
-    * 
-    * \sa dd_function_table::TexImage1D.
-    */
-   void (*TexImage3D)(struct gl_context *ctx,
-                      struct gl_texture_image *texImage,
-                      GLint internalFormat,
-                      GLint width, GLint height, GLint depth, GLint border,
-                      GLenum format, GLenum type, const GLvoid *pixels,
-                      const struct gl_pixelstore_attrib *packing);
 
    /**
     * Called by glTexSubImage1D().  Replace a subset of the target texture
index 694f6fa00105864173a4c064637fae78b5bb007c..5bb21cd80a8c8a864a033bce0763c65b3f4c0e39 100644 (file)
@@ -2606,26 +2606,9 @@ teximage(struct gl_context *ctx, GLuint dims,
                                           border, internalFormat, texFormat);
 
                /* Give the texture to the driver.  <pixels> may be null. */
-               ASSERT(ctx->Driver.TexImage3D);
-               switch (dims) {
-               case 1:
-                  ctx->Driver.TexImage1D(ctx, texImage, internalFormat,
-                                         width, border, format,
-                                         type, pixels, unpack);
-                  break;
-               case 2:
-                  ctx->Driver.TexImage2D(ctx, texImage, internalFormat,
-                                         width, height, border, format,
-                                         type, pixels, unpack);
-                  break;
-               case 3:
-                  ctx->Driver.TexImage3D(ctx, texImage, internalFormat,
-                                         width, height, depth, border, format,
-                                         type, pixels, unpack);
-                  break;
-               default:
-                  _mesa_problem(ctx, "invalid dims=%u in teximage()", dims);
-               }
+               ctx->Driver.TexImage(ctx, dims, texImage, internalFormat,
+                                    width, height, depth, border, format,
+                                    type, pixels, unpack);
 
                check_gen_mipmap(ctx, target, texObj, level);
 
@@ -2968,16 +2951,9 @@ copyteximage(struct gl_context *ctx, GLuint dims,
                                        border, internalFormat, texFormat);
 
             /* Allocate texture memory (no pixel data yet) */
-            if (dims == 1) {
-               ctx->Driver.TexImage1D(ctx, texImage, internalFormat,
-                                      width, border, GL_NONE, GL_NONE, NULL,
-                                      &ctx->Unpack);
-            }
-            else {
-               ctx->Driver.TexImage2D(ctx, texImage, internalFormat,
-                                      width, height, border, GL_NONE, GL_NONE,
-                                      NULL, &ctx->Unpack);
-            }
+            ctx->Driver.TexImage(ctx, dims, texImage, internalFormat,
+                                 width, height, 1, border, GL_NONE, GL_NONE,
+                                 NULL, &ctx->Unpack);
 
             if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY,
                                            &width, &height)) {
index a471bad22b623dcca03d2b83c7ff8b39a70f5fc8..e0494c94028b1c4988a0f9896c27e6a46a64a243 100644 (file)
@@ -807,30 +807,10 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
                                     0, /* border */
                                     GL_RGBA, texFormat);
 
-         switch (dims) {
-        case 0:
-           break;
-         case 1:
-            ctx->Driver.TexImage1D(ctx, texImage, GL_RGBA,
-                                   width, 0,
-                                   GL_RGBA, GL_UNSIGNED_BYTE, texel,
-                                   &ctx->DefaultPacking);
-            break;
-         case 2:
-            ctx->Driver.TexImage2D(ctx, texImage, GL_RGBA,
-                                   width, height, 0,
-                                   GL_RGBA, GL_UNSIGNED_BYTE, texel,
-                                   &ctx->DefaultPacking);
-            break;
-         case 3:
-            ctx->Driver.TexImage3D(ctx, texImage, GL_RGBA,
-                                   width, height, depth, 0,
-                                   GL_RGBA, GL_UNSIGNED_BYTE, texel,
-                                   &ctx->DefaultPacking);
-            break;
-         default:
-            _mesa_problem(ctx, "bad dims in _mesa_get_fallback_texture()");
-         }
+         ctx->Driver.TexImage(ctx, dims, texImage, GL_RGBA,
+                              width, height, depth, 0,
+                              GL_RGBA, GL_UNSIGNED_BYTE, texel,
+                              &ctx->DefaultPacking);
       }
 
       _mesa_test_texobj_completeness(ctx, texObj);
index d368b1868f222bef39ea65d53c92e0c42c91d06c..1aa79625287f9d171b99520ce5e2e2cc00de4b00 100644 (file)
@@ -4261,89 +4261,37 @@ store_texsubimage(struct gl_context *ctx,
 
 
 /**
- * This is the fallback for Driver.TexImage1D().
+ * Fallback code for ctx->Driver.TexImage().
+ * Basically, allocate storage for the texture image, then copy the
+ * user's image into it.
  */
 void
-_mesa_store_teximage1d(struct gl_context *ctx,
-                       struct gl_texture_image *texImage,
-                       GLint internalFormat,
-                       GLint width, GLint border,
-                       GLenum format, GLenum type, const GLvoid *pixels,
-                       const struct gl_pixelstore_attrib *packing)
+_mesa_store_teximage(struct gl_context *ctx,
+                     GLuint dims,
+                     struct gl_texture_image *texImage,
+                     GLint internalFormat,
+                     GLint width, GLint height, GLint depth, GLint border,
+                     GLenum format, GLenum type, const GLvoid *pixels,
+                     const struct gl_pixelstore_attrib *packing)
 {
-   if (width == 0)
-      return;
-
-   /* allocate storage for texture data */
-   if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat,
-                                            width, 1, 1)) {
-      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
-      return;
-   }
-
-   store_texsubimage(ctx, texImage,
-                     0, 0, 0, width, 1, 1,
-                     format, type, pixels, packing, "glTexImage1D");
-}
+   assert(dims == 1 || dims == 2 || dims == 3);
 
-
-/**
- * This is the fallback for Driver.TexImage2D().
- */
-void
-_mesa_store_teximage2d(struct gl_context *ctx,
-                       struct gl_texture_image *texImage,
-                       GLint internalFormat,
-                       GLint width, GLint height, GLint border,
-                       GLenum format, GLenum type, const void *pixels,
-                       const struct gl_pixelstore_attrib *packing)
-{
-   if (width == 0 || height == 0)
-      return;
-
-   /* allocate storage for texture data */
-   if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat,
-                                            width, height, 1)) {
-      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
-      return;
-   }
-
-   store_texsubimage(ctx, texImage,
-                     0, 0, 0, width, height, 1,
-                     format, type, pixels, packing, "glTexImage2D");
-}
-
-
-
-/**
- * This is the fallback for Driver.TexImage3D().
- */
-void
-_mesa_store_teximage3d(struct gl_context *ctx,
-                       struct gl_texture_image *texImage,
-                       GLint internalFormat,
-                       GLint width, GLint height, GLint depth, GLint border,
-                       GLenum format, GLenum type, const void *pixels,
-                       const struct gl_pixelstore_attrib *packing)
-{
    if (width == 0 || height == 0 || depth == 0)
       return;
 
    /* allocate storage for texture data */
    if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat,
                                             width, height, depth)) {
-      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
       return;
    }
 
    store_texsubimage(ctx, texImage,
                      0, 0, 0, width, height, depth,
-                     format, type, pixels, packing, "glTexImage3D");
+                     format, type, pixels, packing, "glTexImage");
 }
 
 
-
-
 /*
  * This is the fallback for Driver.TexSubImage1D().
  */
index 85e33b0fe26f0ab0bb1184a690a7b58482001329..b4995fbc8986ccc9ba991a974b755bd933257a43 100644 (file)
@@ -90,30 +90,13 @@ _mesa_make_temp_float_image(struct gl_context *ctx, GLuint dims,
                            GLbitfield transferOps);
 
 extern void
-_mesa_store_teximage1d(struct gl_context *ctx,
-                       struct gl_texture_image *texImage,
-                       GLint internalFormat,
-                       GLint width, GLint border,
-                       GLenum format, GLenum type, const GLvoid *pixels,
-                       const struct gl_pixelstore_attrib *packing);
-
-
-extern void
-_mesa_store_teximage2d(struct gl_context *ctx,
-                       struct gl_texture_image *texImage,
-                       GLint internalFormat,
-                       GLint width, GLint height, GLint border,
-                       GLenum format, GLenum type, const GLvoid *pixels,
-                       const struct gl_pixelstore_attrib *packing);
-
-
-extern void
-_mesa_store_teximage3d(struct gl_context *ctx,
-                       struct gl_texture_image *texImage,
-                       GLint internalFormat,
-                       GLint width, GLint height, GLint depth, GLint border,
-                       GLenum format, GLenum type, const GLvoid *pixels,
-                       const struct gl_pixelstore_attrib *packing);
+_mesa_store_teximage(struct gl_context *ctx,
+                     GLuint dims,
+                     struct gl_texture_image *texImage,
+                     GLint internalFormat,
+                     GLint width, GLint height, GLint depth, GLint border,
+                     GLenum format, GLenum type, const GLvoid *pixels,
+                     const struct gl_pixelstore_attrib *packing);
 
 
 extern void
index b24f9a1ceffaf63b22b78d6944a0a9cb05764c29..3ab14a1bbd912d216a612664b5a0c1009e7e6d62 100644 (file)
@@ -530,48 +530,17 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage,
 
 
 static void
-st_TexImage3D(struct gl_context * ctx,
-              struct gl_texture_image *texImage,
-              GLint internalFormat,
-              GLint width, GLint height, GLint depth,
-              GLint border,
-              GLenum format, GLenum type, const void *pixels,
-              const struct gl_pixelstore_attrib *unpack)
+st_TexImage(struct gl_context * ctx, GLuint dims,
+            struct gl_texture_image *texImage,
+            GLint internalFormat,
+            GLint width, GLint height, GLint depth, GLint border,
+            GLenum format, GLenum type, const void *pixels,
+            const struct gl_pixelstore_attrib *unpack)
 {
    prep_teximage(ctx, texImage, internalFormat, width, height, depth, border,
                  format, type);
-   _mesa_store_teximage3d(ctx, texImage, internalFormat, width, height, depth,
-                          border, format, type, pixels, unpack);
-}
-
-
-static void
-st_TexImage2D(struct gl_context * ctx,
-              struct gl_texture_image *texImage,
-              GLint internalFormat,
-              GLint width, GLint height, GLint border,
-              GLenum format, GLenum type, const void *pixels,
-              const struct gl_pixelstore_attrib *unpack)
-{
-   prep_teximage(ctx, texImage, internalFormat, width, height, 1, border,
-                 format, type);
-   _mesa_store_teximage2d(ctx, texImage, internalFormat, width, height,
-                          border, format, type, pixels, unpack);
-}
-
-
-static void
-st_TexImage1D(struct gl_context * ctx,
-              struct gl_texture_image *texImage,
-              GLint internalFormat,
-              GLint width, GLint border,
-              GLenum format, GLenum type, const void *pixels,
-              const struct gl_pixelstore_attrib *unpack)
-{
-   prep_teximage(ctx, texImage, internalFormat, width, 1, 1, border,
-                 format, type);
-   _mesa_store_teximage1d(ctx, texImage, internalFormat, width,
-                          border, format, type, pixels, unpack);
+   _mesa_store_teximage(ctx, dims, texImage, internalFormat, width, height, depth,
+                        border, format, type, pixels, unpack);
 }
 
 
@@ -1427,9 +1396,7 @@ void
 st_init_texture_functions(struct dd_function_table *functions)
 {
    functions->ChooseTextureFormat = st_ChooseTextureFormat;
-   functions->TexImage1D = st_TexImage1D;
-   functions->TexImage2D = st_TexImage2D;
-   functions->TexImage3D = st_TexImage3D;
+   functions->TexImage = st_TexImage;
    functions->TexSubImage1D = _mesa_store_texsubimage1d;
    functions->TexSubImage2D = _mesa_store_texsubimage2d;
    functions->TexSubImage3D = _mesa_store_texsubimage3d;