[Mesa-dev] [PATCH 2/3 v2] mesa: Don't allow GL_TEXTURE_BORDER queries outside compat profile

Ian Romanick idr at freedesktop.org
Wed Jun 18 15:11:23 PDT 2014

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

There are no texture borders in any version of OpenGL ES or desktop
OpenGL core profile.

Fixes piglit's gl-3.2-texture-border-deprecated.

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 6767f32..6bf116a 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1108,6 +1108,8 @@ get_tex_level_parameter_image(struct gl_context *ctx,
       case GL_TEXTURE_BORDER:
+         if (ctx->API != API_OPENGL_COMPAT)
+            goto invalid_pname;
          *params = img->Border;
       case GL_TEXTURE_RED_SIZE:

More information about the mesa-dev mailing list