mesa: pass context parameter to gl_renderbuffer::Delete()
[mesa.git] / src / mesa / main / texobj.c
index da27d9236e9abefe26cf0abd3c5dc818d47adf09..d650c75e4e711fe31aab39f5ce360b6e910afeaf 100644 (file)
@@ -108,6 +108,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
           target == GL_TEXTURE_1D_ARRAY_EXT ||
           target == GL_TEXTURE_2D_ARRAY_EXT ||
           target == GL_TEXTURE_EXTERNAL_OES ||
+          target == GL_TEXTURE_CUBE_MAP_ARRAY ||
           target == GL_TEXTURE_BUFFER);
 
    memset(obj, 0, sizeof(*obj));
@@ -144,8 +145,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
    obj->Sampler.MaxAnisotropy = 1.0;
    obj->Sampler.CompareMode = GL_NONE;         /* ARB_shadow */
    obj->Sampler.CompareFunc = GL_LEQUAL;       /* ARB_shadow */
-   obj->Sampler.CompareFailValue = 0.0F;       /* ARB_shadow_ambient */
-   obj->Sampler.DepthMode = GL_LUMINANCE;      /* ARB_depth_texture */
+   obj->DepthMode = GL_LUMINANCE;
    obj->Sampler.CubeMapSeamless = GL_FALSE;
    obj->Swizzle[0] = GL_RED;
    obj->Swizzle[1] = GL_GREEN;
@@ -153,6 +153,8 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
    obj->Swizzle[3] = GL_ALPHA;
    obj->_Swizzle = SWIZZLE_NOOP;
    obj->Sampler.sRGBDecode = GL_DECODE_EXT;
+   obj->BufferObjectFormat = GL_LUMINANCE8;
+   obj->_BufferObjectFormat = MESA_FORMAT_L8;
 }
 
 
@@ -255,9 +257,8 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
    dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy;
    dest->Sampler.CompareMode = src->Sampler.CompareMode;
    dest->Sampler.CompareFunc = src->Sampler.CompareFunc;
-   dest->Sampler.CompareFailValue = src->Sampler.CompareFailValue;
    dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless;
-   dest->Sampler.DepthMode = src->Sampler.DepthMode;
+   dest->DepthMode = src->DepthMode;
    dest->Sampler.sRGBDecode = src->Sampler.sRGBDecode;
    dest->_MaxLevel = src->_MaxLevel;
    dest->_MaxLambda = src->_MaxLambda;
@@ -316,6 +317,7 @@ valid_texture_object(const struct gl_texture_object *tex)
    case GL_TEXTURE_2D_ARRAY_EXT:
    case GL_TEXTURE_BUFFER:
    case GL_TEXTURE_EXTERNAL_OES:
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
       return GL_TRUE;
    case 0x99:
       _mesa_problem(NULL, "invalid reference to a deleted texture object");
@@ -408,16 +410,17 @@ static void
 incomplete(struct gl_texture_object *t, enum base_mipmap bm,
            const char *fmt, ...)
 {
-#if 0
-   va_list args;
-   char s[100];
+   if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_TEXTURE) {
+      va_list args;
+      char s[100];
 
-   va_start(args, fmt);
-   vsnprintf(s, sizeof(s), fmt, args);
-   va_end(args);
+      va_start(args, fmt);
+      vsnprintf(s, sizeof(s), fmt, args);
+      va_end(args);
+
+      _mesa_debug(NULL, "Texture Obj %d incomplete because: %s\n", t->Name, s);
+   }
 
-   printf("Texture Obj %d incomplete because: %s\n", t->Name, s);
-#endif
    if (bm == BASE)
       t->_BaseComplete = GL_FALSE;
    t->_MipmapComplete = GL_FALSE;
@@ -442,12 +445,20 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
 {
    const GLint baseLevel = t->BaseLevel;
    const struct gl_texture_image *baseImage;
-   GLint maxLog2 = 0, maxLevels = 0;
+   GLint maxLevels = 0;
 
    /* We'll set these to FALSE if tests fail below */
    t->_BaseComplete = GL_TRUE;
    t->_MipmapComplete = GL_TRUE;
 
+   if (t->Target == GL_TEXTURE_BUFFER) {
+      /* Buffer textures are always considered complete.  The obvious case where
+       * they would be incomplete (no BO attached) is actually specced to be
+       * undefined rendering results.
+       */
+      return;
+   }
+
    /* Detect cases where the application set the base level to an invalid
     * value.
     */
@@ -478,36 +489,34 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
       return;
    }
 
+   /* Check if the texture values are integer */
+   {
+      GLenum datatype = _mesa_get_format_datatype(baseImage->TexFormat);
+      t->_IsIntegerFormat = datatype == GL_INT || datatype == GL_UNSIGNED_INT;
+   }
+
    /* Compute _MaxLevel (the maximum mipmap level we'll sample from given the
     * mipmap image sizes and GL_TEXTURE_MAX_LEVEL state).
     */
    switch (t->Target) {
    case GL_TEXTURE_1D:
    case GL_TEXTURE_1D_ARRAY_EXT:
-      maxLog2 = baseImage->WidthLog2;
       maxLevels = ctx->Const.MaxTextureLevels;
       break;
    case GL_TEXTURE_2D:
    case GL_TEXTURE_2D_ARRAY_EXT:
-      maxLog2 = MAX2(baseImage->WidthLog2,
-                     baseImage->HeightLog2);
       maxLevels = ctx->Const.MaxTextureLevels;
       break;
    case GL_TEXTURE_3D:
-      maxLog2 = MAX3(baseImage->WidthLog2,
-                     baseImage->HeightLog2,
-                     baseImage->DepthLog2);
       maxLevels = ctx->Const.Max3DTextureLevels;
       break;
    case GL_TEXTURE_CUBE_MAP_ARB:
-      maxLog2 = MAX2(baseImage->WidthLog2,
-                     baseImage->HeightLog2);
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
       maxLevels = ctx->Const.MaxCubeTextureLevels;
       break;
    case GL_TEXTURE_RECTANGLE_NV:
    case GL_TEXTURE_BUFFER:
    case GL_TEXTURE_EXTERNAL_OES:
-      maxLog2 = 0;  /* not applicable */
       maxLevels = 1;  /* no mipmapping */
       break;
    default:
@@ -517,7 +526,8 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
 
    ASSERT(maxLevels > 0);
 
-   t->_MaxLevel = baseLevel + maxLog2;  /* 'p' in the GL spec */
+   t->_MaxLevel =
+      baseLevel + baseImage->MaxNumLevels - 1; /* 'p' in the GL spec */
    t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel);
    t->_MaxLevel = MIN2(t->_MaxLevel, maxLevels - 1); /* 'q' in the GL spec */
 
@@ -534,14 +544,18 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
    }
 
    if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
-      /* make sure that all six cube map level 0 images are the same size */
-      const GLuint w = baseImage->Width2;
-      const GLuint h = baseImage->Height2;
+      /* Make sure that all six cube map level 0 images are the same size.
+       * Note:  we know that the image's width==height (we enforce that
+       * at glTexImage time) so we only need to test the width here.
+       */
       GLuint face;
+      assert(baseImage->Width2 == baseImage->Height);
       for (face = 1; face < 6; face++) {
+         assert(t->Image[face][baseLevel] == NULL ||
+                t->Image[face][baseLevel]->Width2 ==
+                t->Image[face][baseLevel]->Height2);
          if (t->Image[face][baseLevel] == NULL ||
-             t->Image[face][baseLevel]->Width2 != w ||
-             t->Image[face][baseLevel]->Height2 != h) {
+             t->Image[face][baseLevel]->Width2 != baseImage->Width2) {
             incomplete(t, BASE, "Cube face missing or mismatched size");
             return;
          }
@@ -558,7 +572,8 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
       GLint i;
       const GLint minLevel = baseLevel;
       const GLint maxLevel = t->_MaxLevel;
-      GLuint width, height, depth, face, numFaces = 1;
+      const GLuint numFaces = _mesa_num_tex_faces(t->Target);
+      GLuint width, height, depth, face;
 
       if (minLevel > maxLevel) {
          incomplete(t, BASE, "minLevel > maxLevel");
@@ -579,7 +594,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
          if (height > 1 && t->Target != GL_TEXTURE_1D_ARRAY) {
             height /= 2;
          }
-         if (depth > 1 && t->Target != GL_TEXTURE_2D_ARRAY) {
+         if (depth > 1 && t->Target != GL_TEXTURE_2D_ARRAY && t->Target != GL_TEXTURE_CUBE_MAP_ARRAY) {
             depth /= 2;
          }
 
@@ -745,7 +760,17 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
          target = GL_TEXTURE_1D;
          break;
       case TEXTURE_BUFFER_INDEX:
+         dims = 0;
+         target = GL_TEXTURE_BUFFER;
+         break;
+     case TEXTURE_CUBE_ARRAY_INDEX:
+         dims = 3;
+         target = GL_TEXTURE_CUBE_MAP_ARRAY;
+         break;
       case TEXTURE_EXTERNAL_INDEX:
+         dims = 2;
+         target = GL_TEXTURE_EXTERNAL_OES;
+         break;
       default:
          /* no-op */
          return NULL;
@@ -760,7 +785,8 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
       texObj->Sampler.MinFilter = GL_NEAREST;
       texObj->Sampler.MagFilter = GL_NEAREST;
 
-      texFormat = ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA,
+      texFormat = ctx->Driver.ChooseTextureFormat(ctx, target,
+                                                  GL_RGBA, GL_RGBA,
                                                   GL_UNSIGNED_BYTE);
 
       /* need a loop here just for cube maps */
@@ -782,28 +808,9 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
                                     0, /* border */
                                     GL_RGBA, texFormat);
 
-         switch (dims) {
-         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, GL_UNSIGNED_BYTE, texel,
+                              &ctx->DefaultPacking);
       }
 
       _mesa_test_texobj_completeness(ctx, texObj);
@@ -816,6 +823,116 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
 }
 
 
+/**
+ * Compute the size of the given texture object, in bytes.
+ */
+static GLuint
+texture_size(const struct gl_texture_object *texObj)
+{
+   const GLuint numFaces = _mesa_num_tex_faces(texObj->Target);
+   GLuint face, level, size = 0;
+
+   for (face = 0; face < numFaces; face++) {
+      for (level = 0; level < MAX_TEXTURE_LEVELS; level++) {
+         const struct gl_texture_image *img = texObj->Image[face][level];
+         if (img) {
+            GLuint sz = _mesa_format_image_size(img->TexFormat, img->Width,
+                                                img->Height, img->Depth);
+            size += sz;
+         }
+      }
+   }
+
+   return size;
+}
+
+
+/**
+ * Callback called from _mesa_HashWalk()
+ */
+static void
+count_tex_size(GLuint key, void *data, void *userData)
+{
+   const struct gl_texture_object *texObj =
+      (const struct gl_texture_object *) data;
+   GLuint *total = (GLuint *) userData;
+
+   *total = *total + texture_size(texObj);
+}
+
+
+/**
+ * Compute total size (in bytes) of all textures for the given context.
+ * For debugging purposes.
+ */
+GLuint
+_mesa_total_texture_memory(struct gl_context *ctx)
+{
+   GLuint tgt, total = 0;
+
+   _mesa_HashWalk(ctx->Shared->TexObjects, count_tex_size, &total);
+
+   /* plus, the default texture objects */
+   for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
+      total += texture_size(ctx->Shared->DefaultTex[tgt]);
+   }
+
+   return total;
+}
+
+static struct gl_texture_object *
+invalidate_tex_image_error_check(struct gl_context *ctx, GLuint texture,
+                                 GLint level, const char *name)
+{
+   /* The GL_ARB_invalidate_subdata spec says:
+    *
+    *     "If <texture> is zero or is not the name of a texture, the error
+    *     INVALID_VALUE is generated."
+    *
+    * This performs the error check in a different order than listed in the
+    * spec.  We have to get the texture object before we can validate the
+    * other parameters against values in the texture object.
+    */
+   struct gl_texture_object *const t = _mesa_lookup_texture(ctx, texture);
+   if (texture == 0 || t == NULL) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", name);
+      return NULL;
+   }
+
+   /* The GL_ARB_invalidate_subdata spec says:
+    *
+    *     "If <level> is less than zero or greater than the base 2 logarithm
+    *     of the maximum texture width, height, or depth, the error
+    *     INVALID_VALUE is generated."
+    */
+   if (level < 0 || level > t->MaxLevel) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "%s(level)", name);
+      return NULL;
+   }
+
+   /* The GL_ARB_invalidate_subdata spec says:
+    *
+    *     "If the target of <texture> is TEXTURE_RECTANGLE, TEXTURE_BUFFER,
+    *     TEXTURE_2D_MULTISAMPLE, or TEXTURE_2D_MULTISAMPLE_ARRAY, and <level>
+    *     is not zero, the error INVALID_VALUE is generated."
+    */
+   if (level != 0) {
+      switch (t->Target) {
+      case GL_TEXTURE_RECTANGLE:
+      case GL_TEXTURE_BUFFER:
+      case GL_TEXTURE_2D_MULTISAMPLE:
+      case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
+         _mesa_error(ctx, GL_INVALID_VALUE, "%s(level)", name);
+         return NULL;
+
+      default:
+         break;
+      }
+   }
+
+   return t;
+}
+
 /*@}*/
 
 
@@ -1004,27 +1121,41 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
  * \return TEXTURE_x_INDEX or -1 if target is invalid
  */
 static GLint
-target_enum_to_index(GLenum target)
+target_enum_to_index(struct gl_context *ctx, GLenum target)
 {
    switch (target) {
    case GL_TEXTURE_1D:
-      return TEXTURE_1D_INDEX;
+      return _mesa_is_desktop_gl(ctx) ? TEXTURE_1D_INDEX : -1;
    case GL_TEXTURE_2D:
       return TEXTURE_2D_INDEX;
    case GL_TEXTURE_3D:
       return TEXTURE_3D_INDEX;
    case GL_TEXTURE_CUBE_MAP_ARB:
-      return TEXTURE_CUBE_INDEX;
+      return ctx->Extensions.ARB_texture_cube_map
+         ? TEXTURE_CUBE_INDEX : -1;
    case GL_TEXTURE_RECTANGLE_NV:
-      return TEXTURE_RECT_INDEX;
+      return _mesa_is_desktop_gl(ctx) && ctx->Extensions.NV_texture_rectangle
+         ? TEXTURE_RECT_INDEX : -1;
    case GL_TEXTURE_1D_ARRAY_EXT:
-      return TEXTURE_1D_ARRAY_INDEX;
+      return _mesa_is_desktop_gl(ctx)
+         && (ctx->Extensions.EXT_texture_array
+             || ctx->Extensions.MESA_texture_array)
+         ? TEXTURE_1D_ARRAY_INDEX : -1;
    case GL_TEXTURE_2D_ARRAY_EXT:
-      return TEXTURE_2D_ARRAY_INDEX;
+      return (_mesa_is_desktop_gl(ctx)
+              && (ctx->Extensions.EXT_texture_array
+                  || ctx->Extensions.MESA_texture_array))
+         || _mesa_is_gles3(ctx)
+         ? TEXTURE_2D_ARRAY_INDEX : -1;
    case GL_TEXTURE_BUFFER_ARB:
-      return TEXTURE_BUFFER_INDEX;
+      return _mesa_is_desktop_gl(ctx)
+         && ctx->Extensions.ARB_texture_buffer_object
+         ? TEXTURE_BUFFER_INDEX : -1;
    case GL_TEXTURE_EXTERNAL_OES:
-      return TEXTURE_EXTERNAL_INDEX;
+      return _mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external
+         ? TEXTURE_EXTERNAL_INDEX : -1;
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+      return TEXTURE_CUBE_ARRAY_INDEX;
    default:
       return -1;
    }
@@ -1059,7 +1190,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
       _mesa_debug(ctx, "glBindTexture %s %d\n",
                   _mesa_lookup_enum_by_nr(target), (GLint) texName);
 
-   targetIndex = target_enum_to_index(target);
+   targetIndex = target_enum_to_index(ctx, target);
    if (targetIndex < 0) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)");
       return;
@@ -1089,6 +1220,11 @@ _mesa_BindTexture( GLenum target, GLuint texName )
          }
       }
       else {
+         if (ctx->API == API_OPENGL_CORE) {
+            _mesa_error(ctx, GL_INVALID_OPERATION, "glBindTexture(non-gen name)");
+            return;
+         }
+
          /* if this is a new texture id, allocate a texture object now */
          newTexObj = ctx->Driver.NewTextureObject(ctx, texName, target);
          if (!newTexObj) {
@@ -1283,4 +1419,164 @@ _mesa_unlock_context_textures( struct gl_context *ctx )
    _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
 }
 
+void GLAPIENTRY
+_mesa_InvalidateTexSubImage(GLuint texture, GLint level, GLint xoffset,
+                            GLint yoffset, GLint zoffset, GLsizei width,
+                            GLsizei height, GLsizei depth)
+{
+   struct gl_texture_object *t;
+   struct gl_texture_image *image;
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+   t = invalidate_tex_image_error_check(ctx, texture, level,
+                                        "glInvalidateTexSubImage");
+
+   /* The GL_ARB_invalidate_subdata spec says:
+    *
+    *     "...the specified subregion must be between -<b> and <dim>+<b> where
+    *     <dim> is the size of the dimension of the texture image, and <b> is
+    *     the size of the border of that texture image, otherwise
+    *     INVALID_VALUE is generated (border is not applied to dimensions that
+    *     don't exist in a given texture target)."
+    */
+   image = t->Image[0][level];
+   if (image) {
+      int xBorder;
+      int yBorder;
+      int zBorder;
+      int imageWidth;
+      int imageHeight;
+      int imageDepth;
+
+      /* The GL_ARB_invalidate_subdata spec says:
+       *
+       *     "For texture targets that don't have certain dimensions, this
+       *     command treats those dimensions as having a size of 1. For
+       *     example, to invalidate a portion of a two-dimensional texture,
+       *     the application would use <zoffset> equal to zero and <depth>
+       *     equal to one."
+       */
+      switch (t->Target) {
+      case GL_TEXTURE_BUFFER:
+         xBorder = 0;
+         yBorder = 0;
+         zBorder = 0;
+         imageWidth = 1;
+         imageHeight = 1;
+         imageDepth = 1;
+         break;
+      case GL_TEXTURE_1D:
+         xBorder = image->Border;
+         yBorder = 0;
+         zBorder = 0;
+         imageWidth = image->Width;
+         imageHeight = 1;
+         imageDepth = 1;
+         break;
+      case GL_TEXTURE_1D_ARRAY:
+         xBorder = image->Border;
+         yBorder = 0;
+         zBorder = 0;
+         imageWidth = image->Width;
+         imageHeight = image->Height;
+         imageDepth = 1;
+         break;
+      case GL_TEXTURE_2D:
+      case GL_TEXTURE_CUBE_MAP:
+      case GL_TEXTURE_RECTANGLE:
+      case GL_TEXTURE_2D_MULTISAMPLE:
+         xBorder = image->Border;
+         yBorder = image->Border;
+         zBorder = 0;
+         imageWidth = image->Width;
+         imageHeight = image->Height;
+         imageDepth = 1;
+         break;
+      case GL_TEXTURE_2D_ARRAY:
+      case GL_TEXTURE_CUBE_MAP_ARRAY:
+         xBorder = image->Border;
+         yBorder = image->Border;
+         zBorder = 0;
+         imageWidth = image->Width;
+         imageHeight = image->Height;
+         imageDepth = image->Depth;
+         break;
+      case GL_TEXTURE_3D:
+         xBorder = image->Border;
+         yBorder = image->Border;
+         zBorder = image->Border;
+         imageWidth = image->Width;
+         imageHeight = image->Height;
+         imageDepth = image->Depth;
+         break;
+      default:
+         assert(!"Should not get here.");
+         xBorder = 0;
+         yBorder = 0;
+         zBorder = 0;
+         imageWidth = 0;
+         imageHeight = 0;
+         imageDepth = 0;
+         break;
+      }
+
+      if (xoffset < -xBorder) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glInvalidateSubTexImage(xoffset)");
+         return;
+      }
+
+      if (xoffset + width > imageWidth + xBorder) {
+         _mesa_error(ctx, GL_INVALID_VALUE,
+                     "glInvalidateSubTexImage(xoffset+width)");
+         return;
+      }
+
+      if (yoffset < -yBorder) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glInvalidateSubTexImage(yoffset)");
+         return;
+      }
+
+      if (yoffset + height > imageHeight + yBorder) {
+         _mesa_error(ctx, GL_INVALID_VALUE,
+                     "glInvalidateSubTexImage(yoffset+height)");
+         return;
+      }
+
+      if (zoffset < -zBorder) {
+         _mesa_error(ctx, GL_INVALID_VALUE,
+                     "glInvalidateSubTexImage(zoffset)");
+         return;
+      }
+
+      if (zoffset + depth  > imageDepth + zBorder) {
+         _mesa_error(ctx, GL_INVALID_VALUE,
+                     "glInvalidateSubTexImage(zoffset+depth)");
+         return;
+      }
+   }
+
+   /* We don't actually do anything for this yet.  Just return after
+    * validating the parameters and generating the required errors.
+    */
+   return;
+}
+
+void GLAPIENTRY
+_mesa_InvalidateTexImage(GLuint texture, GLint level)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+   invalidate_tex_image_error_check(ctx, texture, level,
+                                    "glInvalidateTexImage");
+
+   /* We don't actually do anything for this yet.  Just return after
+    * validating the parameters and generating the required errors.
+    */
+   return;
+}
+
 /*@}*/