[Mesa-dev] [PATCH 2/2] mesa: Generate GL_INVALID_OPERATION for unsupported DSA TexStorage functions

Ian Romanick idr at freedesktop.org
Mon Jan 20 12:07:12 PST 2014


From: Ian Romanick <ian.d.romanick at intel.com>

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 at intel.com>
---
I also thought about just having these functions call _mesa_generic_nop
instead.  That would make the code smaller, but it would mean that we
lose the specific error messages.

 src/mesa/main/texstorage.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index cc9f38b..c1d2a5a 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -469,12 +469,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");
 }
 
 
@@ -483,13 +487,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");
 }
 
 
@@ -499,6 +507,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;
@@ -506,5 +516,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");
 }
-- 
1.8.1.4



More information about the mesa-dev mailing list