diff options
author | Dave Airlie <[email protected]> | 2015-08-24 09:52:12 +1000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-09-02 21:06:36 +0100 |
commit | 278346a7d6493685e29ae1ba7d9c2658fa323453 (patch) | |
tree | 2eac8f8e022bae6a37824615251e83f1e3bc6afc | |
parent | 9a6b7e9dcd38c768dbcf19565b819889bcb20218 (diff) |
mesa/texgetimage: fix missing stencil check
GetTexImage can read to stencil8 but only from
a stencil or depthstencil textures.
This fixes a bunch of failures in CTS
GL33-CTS.gtf32.GL3Tests.packed_pixels
Reviewed-by: Marek Olšák <[email protected]>
Cc: "11.0" <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
(cherry picked from commit c1452983b44cc8ee238b8c7e2cfca1105c707487)
[Emil Velikov: use glGetTex%sImage + suffix, instead of caller]
Signed-off-by: Emil Velikov <[email protected]>
-rw-r--r-- | src/mesa/main/texgetimage.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 92b4d6795c6..f97d0ef4b3d 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -915,6 +915,13 @@ getteximage_error_check(struct gl_context *ctx, "glGetTex%sImage(format=GL_STENCIL_INDEX)", suffix); return GL_TRUE; } + else if (_mesa_is_stencil_format(format) + && !_mesa_is_depthstencil_format(baseFormat) + && !_mesa_is_stencil_format(baseFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTex%sImage(format mismatch)", suffix); + return true; + } else if (_mesa_is_ycbcr_format(format) && !_mesa_is_ycbcr_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, |