summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-05-20 23:41:59 +1200
committerChris Forbes <[email protected]>2014-06-10 07:42:44 +1200
commitd6e60cb504b5c05f4d7f5a71f5a81c25e53d3785 (patch)
treec3dbe72652d0dc7480c499e399deea3e3b4e6f2d /src/mesa/main/texgetimage.c
parent75a5823749420bbbb71a00abe482bd40d4d2c97b (diff)
mesa: Emit errors for inconsistent compressed pixel store state
V2: Use bool rather than GLboolean for internal function Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r--src/mesa/main/texgetimage.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 1ac707d134c..c22fb9b44f8 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -963,7 +963,7 @@ getcompressedteximage_error_check(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
- GLuint compressedSize;
+ GLuint compressedSize, dimensions;
if (!legal_getteximage_target(ctx, target)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImage(target=0x%x)",
@@ -1004,6 +1004,14 @@ getcompressedteximage_error_check(struct gl_context *ctx, GLenum target,
texImage->Height,
texImage->Depth);
+ /* Check for invalid pixel storage modes */
+ dimensions = _mesa_get_texture_dimensions(texImage->TexObject->Target);
+ if (!_mesa_compressed_texture_pixel_storage_error_check(ctx, dimensions,
+ &ctx->Pack,
+ "glGetCompressedTexImageARB")) {
+ return GL_TRUE;
+ }
+
if (!_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
/* do bounds checking on writing to client memory */
if (clientMemSize < (GLsizei) compressedSize) {