initial work for GL_ARB_texture_compression
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 23 May 2000 20:10:49 +0000 (20:10 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 23 May 2000 20:10:49 +0000 (20:10 +0000)
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/dlist.c
src/mesa/main/extensions.c
src/mesa/main/get.c
src/mesa/main/hint.c
src/mesa/main/state.c
src/mesa/main/teximage.c
src/mesa/main/teximage.h
src/mesa/main/texstate.c

index 5edc3b4f5c2e885701f01d9988181254b7ee471a..3ccd49614ac29521ffb0b3e37935291cea98a68b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: config.h,v 1.13 2000/05/07 20:41:30 brianp Exp $ */
+/* $Id: config.h,v 1.14 2000/05/23 20:10:49 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
 #define MAX_CONVOLUTION_WIDTH 5
 #define MAX_CONVOLUTION_HEIGHT 5
 
+/* GL_ARB_texture_compression */
+#define MAX_COMPRESSED_TEXTURE_FORMATS 25
+
+
 
 /*
  * Mesa-specific parameters
index e106b0343ed764c49f6aed5da0ce500c5c59dd54..cb463003c8b58f966373fdb6117c41e06d46b1fd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.66 2000/05/22 16:33:20 brianp Exp $ */
+/* $Id: context.c,v 1.67 2000/05/23 20:10:49 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -722,6 +722,7 @@ init_attrib_groups( GLcontext *ctx )
    ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
    ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
    ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
+   ctx->Const.NumCompressedTextureFormats = 0;
 
    /* Modelview matrix */
    gl_matrix_ctr( &ctx->ModelView );
@@ -900,11 +901,12 @@ init_attrib_groups( GLcontext *ctx )
    ctx->Hint.LineSmooth = GL_DONT_CARE;
    ctx->Hint.PolygonSmooth = GL_DONT_CARE;
    ctx->Hint.Fog = GL_DONT_CARE;
-
    ctx->Hint.AllowDrawWin = GL_TRUE;
    ctx->Hint.AllowDrawFrg = GL_TRUE;
    ctx->Hint.AllowDrawMem = GL_TRUE;
    ctx->Hint.StrictLighting = GL_TRUE;
+   ctx->Hint.ClipVolumeClipping = GL_DONT_CARE;
+   ctx->Hint.TextureCompression = GL_DONT_CARE;
 
    /* Histogram group */
    ctx->Histogram.Width = 0;
index 2ada02ea06bca7dbae3e81edf81d8374b05a9375..9d80cb5004e2beac734d3923f97f7f7d441916d1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dlist.c,v 1.39 2000/05/19 13:12:29 brianp Exp $ */
+/* $Id: dlist.c,v 1.40 2000/05/23 20:10:49 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -3559,6 +3559,8 @@ static void save_ClientActiveTextureARB( GLenum target )
 
 
 
+/* GL_ARB_transpose_matrix */
+
 static void save_LoadTransposeMatrixdARB( const GLdouble m[16] )
 {
    GLdouble tm[16];
@@ -3606,6 +3608,62 @@ static void save_PixelTexGenSGIX(GLenum mode)
 }
 
 
+/* GL_ARB_texture_compression */
+static void
+save_CompressedTexImage1DARB(GLenum target, GLint level,
+                             GLenum internalformat, GLsizei width,
+                             GLint border, GLsizei imageSize,
+                             const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexImage2DARB(GLenum target, GLint level,
+                             GLenum internalformat, GLsizei width,
+                             GLsizei height, GLint border, GLsizei imageSize,
+                             const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexImage3DARB(GLenum target, GLint level,
+                             GLenum internalformat, GLsizei width,
+                             GLsizei height, GLsizei depth, GLint border,
+                             GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+                                GLsizei width, GLenum format,
+                                GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+                                GLint yoffset, GLsizei width, GLsizei height,
+                                GLenum format, GLsizei imageSize,
+                                const GLvoid *data)
+{
+}
+
+
+static void
+save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+                                GLint yoffset, GLint zoffset, GLsizei width,
+                                GLsizei height, GLsizei depth, GLenum format,
+                                GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+/* GL_SGIS_pixel_texture */
+
 static void save_PixelTexGenParameteriSGIS(GLenum target, GLint value)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5181,6 +5239,14 @@ _mesa_init_dlist_table( struct _glapi_table *table )
    table->MultTransposeMatrixdARB = save_MultTransposeMatrixdARB;
    table->MultTransposeMatrixfARB = save_MultTransposeMatrixfARB;
 
+   /* ARB 12. GL_ARB_texture_compression */
+   table->CompressedTexImage3DARB = save_CompressedTexImage3DARB;
+   table->CompressedTexImage2DARB = save_CompressedTexImage2DARB;
+   table->CompressedTexImage1DARB = save_CompressedTexImage1DARB;
+   table->CompressedTexSubImage3DARB = save_CompressedTexSubImage3DARB;
+   table->CompressedTexSubImage2DARB = save_CompressedTexSubImage2DARB;
+   table->CompressedTexSubImage1DARB = save_CompressedTexSubImage1DARB;
+   table->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
 }
 
 
index bcb9e0c426c97a8355a9dfed9d5a6a9b94ea62f8..897a973baf409b1cd5ccf288bca288ce58923ffc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: extensions.c,v 1.27 2000/05/22 18:46:52 brianp Exp $ */
+/* $Id: extensions.c,v 1.28 2000/05/23 20:10:49 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -51,6 +51,7 @@ struct extension {
 static struct { int enabled; const char *name; } default_extensions[] = {
    { DEFAULT_OFF,    "GL_ARB_imaging" },  /* in progress */
    { DEFAULT_ON,     "GL_ARB_multitexture" },
+   { DEFAULT_OFF,    "GL_ARB_texture_compression" },  /* in progress */
    { DEFAULT_OFF,    "GL_ARB_texture_cube_map" },  /* in progress */
    { ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" },
    { ALWAYS_ENABLED, "GL_EXT_abgr" },
@@ -101,6 +102,7 @@ update_extension_flags( GLcontext *ctx )
    ctx->Extensions.HaveTextureLodBias = gl_extension_is_enabled(ctx, "GL_EXT_texture_lod_bias");
    ctx->Extensions.HaveHpOcclusionTest = gl_extension_is_enabled(ctx, "GL_HP_occlusion_test");
    ctx->Extensions.HaveTextureCubeMap = gl_extension_is_enabled(ctx, "GL_ARB_texture_cube_map");
+   ctx->Extensions.HaveTextureCompression = gl_extension_is_enabled(ctx, "GL_ARB_texture_compression");
 }
 
 
index a7d3d5658adeec85b5d70457f4ea96ea5c469c2e..2c349c77191293b82420c5745e0447bc0415459b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: get.c,v 1.28 2000/05/23 17:14:49 brianp Exp $ */
+/* $Id: get.c,v 1.29 2000/05/23 20:10:49 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -974,6 +974,31 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
             gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
          break;
 
+      /* GL_ARB_texture_compression */
+      case GL_TEXTURE_COMPRESSION_HINT_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+         break;
+      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = INT_TO_BOOL(ctx->Const.NumCompressedTextureFormats);
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+         break;
+      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            GLuint i;
+            for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+               params[i] = INT_TO_BOOL(ctx->Const.CompressedTextureFormats[i]);
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+         break;
+
       /* GL_PGI_misc_hints */
       case GL_STRICT_DEPTHFUNC_HINT_PGI:
         *params = ENUM_TO_BOOL(GL_NICEST);
@@ -2092,6 +2117,31 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
             gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
          return;
 
+      /* GL_ARB_texture_compression */
+      case GL_TEXTURE_COMPRESSION_HINT_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLdouble) ctx->Hint.TextureCompression;
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+         break;
+      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLdouble) ctx->Const.NumCompressedTextureFormats;
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+         break;
+      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            GLuint i;
+            for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+               params[i] = (GLdouble) ctx->Const.CompressedTextureFormats[i];
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+         break;
+
       /* GL_PGI_misc_hints */
       case GL_STRICT_DEPTHFUNC_HINT_PGI:
         *params = ENUM_TO_DOUBLE(GL_NICEST);
@@ -3209,6 +3259,31 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
             gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
          return;
 
+      /* GL_ARB_texture_compression */
+      case GL_TEXTURE_COMPRESSION_HINT_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLfloat) ctx->Hint.TextureCompression;
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+         break;
+      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLfloat) ctx->Const.NumCompressedTextureFormats;
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+         break;
+      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            GLuint i;
+            for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+               params[i] = (GLfloat) ctx->Const.CompressedTextureFormats[i];
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+         break;
+
       /* GL_PGI_misc_hints */
       case GL_STRICT_DEPTHFUNC_HINT_PGI:
         *params = ENUM_TO_FLOAT(GL_NICEST);
@@ -4300,6 +4375,31 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
             gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
          return;
 
+      /* GL_ARB_texture_compression */
+      case GL_TEXTURE_COMPRESSION_HINT_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLint) ctx->Hint.TextureCompression;
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+         break;
+      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLint) ctx->Const.NumCompressedTextureFormats;
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+         break;
+      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            GLuint i;
+            for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+               params[i] = (GLint) ctx->Const.CompressedTextureFormats[i];
+         }
+         else
+            gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+         break;
+
       /* GL_PGI_misc_hints */
       case GL_STRICT_DEPTHFUNC_HINT_PGI:
         *params = (GL_NICEST);
index 3621176b37e8b2553f180fda7381636008e73616..7fb0e743b061455dda07eb5cff22db0630859862 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hint.c,v 1.3 2000/04/10 15:52:26 brianp Exp $ */
+/* $Id: hint.c,v 1.4 2000/05/23 20:10:50 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -121,13 +121,23 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode )
       case GL_NATIVE_GRAPHICS_HANDLE_PGI:
          break;
 
-         /* GL_EXT_clip_volume_hint */
+      /* GL_EXT_clip_volume_hint */
       case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
          ctx->Hint.ClipVolumeClipping = mode;
          break;
 
+      /* GL_ARB_texture_compression */
+      case GL_TEXTURE_COMPRESSION_HINT_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            ctx->Hint.TextureCompression = mode;
+         }
+         else {
+            gl_error(ctx, GL_INVALID_ENUM, "glHint(target)");
+         }
+         break;
+
       default:
-         gl_error( ctx, GL_INVALID_ENUM, "glHint(target)" );
+         gl_error(ctx, GL_INVALID_ENUM, "glHint(target)");
          return GL_FALSE;
    }
 
index ead81566c88e7da81b169beaa9c9f37266057897..9eb8aafb675fbf4c0be7cb61f5316546ee6cbafc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.12 2000/05/10 22:36:05 brianp Exp $ */
+/* $Id: state.c,v 1.13 2000/05/23 20:10:50 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -641,9 +641,20 @@ _mesa_init_exec_table(struct _glapi_table *exec)
    exec->LoadTransposeMatrixfARB = _mesa_LoadTransposeMatrixfARB;
    exec->MultTransposeMatrixdARB = _mesa_MultTransposeMatrixdARB;
    exec->MultTransposeMatrixfARB = _mesa_MultTransposeMatrixfARB;
+
+   /* ARB 12. GL_ARB_texture_compression */
+   exec->CompressedTexImage3DARB = _mesa_CompressedTexImage3DARB;
+   exec->CompressedTexImage2DARB = _mesa_CompressedTexImage2DARB;
+   exec->CompressedTexImage1DARB = _mesa_CompressedTexImage1DARB;
+   exec->CompressedTexSubImage3DARB = _mesa_CompressedTexSubImage3DARB;
+   exec->CompressedTexSubImage2DARB = _mesa_CompressedTexSubImage2DARB;
+   exec->CompressedTexSubImage1DARB = _mesa_CompressedTexSubImage1DARB;
+   exec->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
+
 }
 
 
+
 /**********************************************************************/
 /*****                   State update logic                       *****/
 /**********************************************************************/
index d3d8bd75c29c764be1a43f3f21a3f10ab1859351..30677e3216fba2692d741dce0dfe1b95c1f7499e 100644 (file)
@@ -2369,3 +2369,63 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
       }
    }
 }
+
+
+
+void
+_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
+                              GLenum internalformat, GLsizei width,
+                              GLint border, GLsizei imageSize,
+                              const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
+                              GLenum internalformat, GLsizei width,
+                              GLsizei height, GLint border, GLsizei imageSize,
+                              const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
+                              GLenum internalformat, GLsizei width,
+                              GLsizei height, GLsizei depth, GLint border,
+                              GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+                                 GLsizei width, GLenum format,
+                                 GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+                                 GLint yoffset, GLsizei width, GLsizei height,
+                                 GLenum format, GLsizei imageSize,
+                                 const GLvoid *data)
+{
+}
+
+
+void
+_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+                                 GLint yoffset, GLint zoffset, GLsizei width,
+                                 GLsizei height, GLsizei depth, GLenum format,
+                                 GLsizei imageSize, const GLvoid *data)
+{
+}
+
+
+void
+_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img)
+{
+}
index 433bdc34e6ccca95d51a5d5379448373706310bc..bbf1836eabb6a32ff0755d745b1330cb5304ec65 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: teximage.h,v 1.8 2000/05/23 17:14:49 brianp Exp $ */
+/* $Id: teximage.h,v 1.9 2000/05/23 20:10:50 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -145,5 +145,47 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
                          GLint xoffset, GLint yoffset, GLint zoffset,
                          GLint x, GLint y, GLsizei width, GLsizei height );
 
+
+
+extern void
+_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
+                              GLenum internalformat, GLsizei width,
+                              GLint border, GLsizei imageSize,
+                              const GLvoid *data);
+
+extern void
+_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
+                              GLenum internalformat, GLsizei width,
+                              GLsizei height, GLint border, GLsizei imageSize,
+                              const GLvoid *data);
+
+extern void
+_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
+                              GLenum internalformat, GLsizei width,
+                              GLsizei height, GLsizei depth, GLint border,
+                              GLsizei imageSize, const GLvoid *data);
+
+
+extern void
+_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+                                 GLsizei width, GLenum format,
+                                 GLsizei imageSize, const GLvoid *data);
+
+extern void
+_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+                                 GLint yoffset, GLsizei width, GLsizei height,
+                                 GLenum format, GLsizei imageSize,
+                                 const GLvoid *data);
+
+extern void
+_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+                                 GLint yoffset, GLint zoffset, GLsizei width,
+                                 GLsizei height, GLsizei depth, GLenum format,
+                                 GLsizei imageSize, const GLvoid *data);
+
+extern void
+_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
+
+
 #endif
 
index 0e55fc9b1f3231c7f762233adb76b12134d9d8d3..32ce6005630e6dc0031106de980624d3326afe7e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.12 2000/05/23 17:14:49 brianp Exp $ */
+/* $Id: texstate.c,v 1.13 2000/05/23 20:10:50 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -463,6 +463,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
    const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
    const struct gl_texture_image *img = NULL;
    GLuint dimensions;
+   GLboolean isProxy;
 
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexLevelParameter");
 
@@ -486,6 +487,11 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
       return;
    }
 
+   isProxy = (target == GL_PROXY_TEXTURE_1D) ||
+             (target == GL_PROXY_TEXTURE_2D) ||
+             (target == GL_PROXY_TEXTURE_3D) ||
+             (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB);
+
    switch (pname) {
       case GL_TEXTURE_WIDTH:
          *params = img->Width;
@@ -535,9 +541,31 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
       case GL_TEXTURE_INDEX_SIZE_EXT:
          *params = img->IndexBits;
          return;
+
+      /* GL_ARB_texture_compression */
+      case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            if (img->IsCompressed && !isProxy)
+               *params = img->CompressedSize;
+            else
+               gl_error(ctx, GL_INVALID_OPERATION,
+                        "glGetTexLevelParameter[if]v(pname)");
+         }
+         else {
+            gl_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+         }
+         return;
+      case GL_TEXTURE_COMPRESSED_ARB:
+         if (ctx->Extensions.HaveTextureCompression) {
+            *params = (GLint) img->IsCompressed;
+         }
+         else {
+            gl_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
+         }
+         return;
+
       default:
-         gl_error( ctx, GL_INVALID_ENUM,
-                   "glGetTexLevelParameter[if]v(pname)" );
+         gl_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)");
    }
 }