summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2014-03-18 16:52:24 -0700
committerAnuj Phogat <anuj.phogat@gmail.com>2014-05-01 10:58:39 -0700
commit5388fc157e2b78d67a05dc923b98857e6449cf1e (patch)
tree6f2a63bc008f600dedad834bc9970f5249103a0f
parent340658e44f87c98e840b98029c9b5a81d1bed837 (diff)
mesa: Add error condition for format=STENCIL_INDEX in glGetTexImage()
From OpenGL 4.0 spec, page 306: "Calling GetTexImage with a format of STENCIL_INDEX causes the error INVALID_ENUM." Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--src/mesa/main/texgetimage.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 2beb0abe6d2..754c3658ced 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -838,6 +838,11 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
return GL_TRUE;
}
+ else if (_mesa_is_stencil_format(format)
+ && !ctx->Extensions.ARB_texture_stencil8) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format=GL_STENCIL_INDEX)");
+ return GL_TRUE;
+ }
else if (_mesa_is_ycbcr_format(format)
&& !_mesa_is_ycbcr_format(baseFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");