Skip to content
Snippets Groups Projects
Commit 278346a7 authored by Dave Airlie's avatar Dave Airlie Committed by Emil Velikov
Browse files

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: default avatarMarek Olšák <marek.olsak@amd.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
(cherry picked from commit c1452983)
[Emil Velikov: use glGetTex%sImage + suffix, instead of caller]
Signed-off-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
parent 9a6b7e9d
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment