Mesa (master): mesa: check that internalformat of CopyTexImage*D is not 1, 2, 3, 4

Nicolai Hähnle nh at kemper.freedesktop.org
Fri Jan 8 15:59:14 UTC 2016


Module: Mesa
Branch: master
Commit: d6db7ceedf60622a3c17334d764ca1bcddb5935a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d6db7ceedf60622a3c17334d764ca1bcddb5935a

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Thu Jan  7 15:27:52 2016 -0500

mesa: check that internalformat of CopyTexImage*D is not 1, 2, 3, 4

The piglit copyteximage check has recently been augmented to test this, but
apparently it hasn't been fixed in Mesa so far.

This language also already appears in the OpenGL 2.1 spec (Ian).

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/teximage.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 73b3318..50141be 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2247,6 +2247,22 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
                      _mesa_enum_to_string(internalFormat));
          return GL_TRUE;
       }
+   } else {
+      /*
+       * Section 8.6 (Alternate Texture Image Specification Commands) of the
+       * OpenGL 4.5 (Compatibility Profile) spec says:
+       *
+       *     "Parameters level, internalformat, and border are specified using
+       *     the same values, with the same meanings, as the corresponding
+       *     arguments of TexImage2D, except that internalformat may not be
+       *     specified as 1, 2, 3, or 4."
+       */
+      if (internalFormat >= 1 && internalFormat <= 4) {
+         _mesa_error(ctx, GL_INVALID_ENUM,
+                     "glCopyTexImage%dD(internalFormat=%d)", dimensions,
+                     internalFormat);
+         return GL_TRUE;
+      }
    }
 
    baseFormat = _mesa_base_tex_format(ctx, internalFormat);




More information about the mesa-commit mailing list