mesa: Generate GL_INVALID_OPERATION for unsupported DSA TexStorage functions
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 18 Dec 2013 22:43:19 +0000 (14:43 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 21 Jan 2014 23:39:54 +0000 (15:39 -0800)
We have to make the functions available to work around a GLEW bug (see
comments already in the code), but if an application calls one of these
functions we should still generate GL_INVALID_OPERATION.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/texstorage.c

index 97bb43cfda4de96751cd30c4b33990616810f286..22208572f51877037413fb44060b9398c05fb705 100644 (file)
@@ -464,12 +464,16 @@ _mesa_TextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels,
                           GLenum internalformat,
                           GLsizei width)
 {
+   GET_CURRENT_CONTEXT(ctx);
+
    (void) texture;
    (void) target;
    (void) levels;
    (void) internalformat;
    (void) width;
-   /* no-op */
+
+   _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glTextureStorage1DEXT not supported");
 }
 
 
@@ -478,13 +482,17 @@ _mesa_TextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels,
                           GLenum internalformat,
                           GLsizei width, GLsizei height)
 {
+   GET_CURRENT_CONTEXT(ctx);
+
    (void) texture;
    (void) target;
    (void) levels;
    (void) internalformat;
    (void) width;
    (void) height;
-   /* no-op */
+
+   _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glTextureStorage2DEXT not supported");
 }
 
 
@@ -494,6 +502,8 @@ _mesa_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels,
                           GLenum internalformat,
                           GLsizei width, GLsizei height, GLsizei depth)
 {
+   GET_CURRENT_CONTEXT(ctx);
+
    (void) texture;
    (void) target;
    (void) levels;
@@ -501,5 +511,7 @@ _mesa_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels,
    (void) width;
    (void) height;
    (void) depth;
-   /* no-op */
+
+   _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glTextureStorage3DEXT not supported");
 }