Mesa (master): mesa: Don't allow GL_TEXTURE_{LUMINANCE, INTENSITY}_* queries outside compat profile

Ian Romanick idr at kemper.freedesktop.org
Tue Jul 15 17:54:57 UTC 2014


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Jun 16 17:57:30 2014 -0700

mesa: Don't allow GL_TEXTURE_{LUMINANCE,INTENSITY}_* queries outside compat profile

There are no queries for GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_LUMINANCE_TYPE, or
GL_TEXTURE_INTENSITY_TYPE in any version of OpenGL ES or desktop OpenGL
core profile.

NOTE: Without changes to piglit, this regresses
required-sized-texture-formats.

v2: Rebase on different initial change.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Cc: "10.2 <mesa-stable at lists.freedesktop.org>

---

 src/mesa/main/texparam.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 6bf116a..30dd0b9 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1123,6 +1123,8 @@ get_tex_level_parameter_image(struct gl_context *ctx,
          break;
       case GL_TEXTURE_INTENSITY_SIZE:
       case GL_TEXTURE_LUMINANCE_SIZE:
+         if (ctx->API != API_OPENGL_COMPAT)
+            goto invalid_pname;
          if (_mesa_base_format_has_channel(img->_BaseFormat, pname)) {
             *params = _mesa_get_format_bits(texFormat, pname);
             if (*params == 0) {
@@ -1169,12 +1171,15 @@ get_tex_level_parameter_image(struct gl_context *ctx,
          break;
 
       /* GL_ARB_texture_float */
+      case GL_TEXTURE_LUMINANCE_TYPE_ARB:
+      case GL_TEXTURE_INTENSITY_TYPE_ARB:
+         if (ctx->API != API_OPENGL_COMPAT)
+            goto invalid_pname;
+         /* FALLTHROUGH */
       case GL_TEXTURE_RED_TYPE_ARB:
       case GL_TEXTURE_GREEN_TYPE_ARB:
       case GL_TEXTURE_BLUE_TYPE_ARB:
       case GL_TEXTURE_ALPHA_TYPE_ARB:
-      case GL_TEXTURE_LUMINANCE_TYPE_ARB:
-      case GL_TEXTURE_INTENSITY_TYPE_ARB:
       case GL_TEXTURE_DEPTH_TYPE_ARB:
          if (!ctx->Extensions.ARB_texture_float)
             goto invalid_pname;




More information about the mesa-commit mailing list