[Mesa-stable] [PATCH 3/3] mesa: Don't allow GL_TEXTURE_{LUMINANCE, INTENSITY}_* queries outside compat profile
Ian Romanick
idr at freedesktop.org
Mon Jun 16 18:34:13 PDT 2014
From: Ian Romanick <ian.d.romanick at intel.com>
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.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: "10.2 <mesa-stable at lists.freedesktop.org>
---
src/mesa/main/texparam.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index f67745b..38267e9 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1070,8 +1070,11 @@ get_tex_level_parameter_image(struct gl_context *ctx,
case GL_TEXTURE_GREEN_SIZE:
case GL_TEXTURE_BLUE_SIZE:
case GL_TEXTURE_ALPHA_SIZE:
+ break;
case GL_TEXTURE_INTENSITY_SIZE:
case GL_TEXTURE_LUMINANCE_SIZE:
+ if (ctx->API != API_OPENGL_COMPAT)
+ goto invalid_pname;
break;
case GL_TEXTURE_DEPTH_SIZE_ARB:
if (!ctx->Extensions.ARB_depth_texture)
@@ -1087,12 +1090,15 @@ get_tex_level_parameter_image(struct gl_context *ctx,
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
case GL_TEXTURE_COMPRESSED:
break;
+ 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;
--
1.8.1.4
More information about the mesa-stable
mailing list