aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/drawpix.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-10-01 16:02:11 +0000
committerBrian Paul <[email protected]>2005-10-01 16:02:11 +0000
commit3d61c2e778e5592a52eef21fab6cc301b54f449e (patch)
tree4319cac1fc2b5756899cc85738b47004ca8613d0 /src/mesa/main/drawpix.c
parentd0529b67f48507ce52ce06305fb2673f5beb2851 (diff)
move around some error checking
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r--src/mesa/main/drawpix.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 2872a03b2fa..701ac6aa773 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -44,6 +44,14 @@ error_check_format_type(GLcontext *ctx, GLenum format, GLenum type,
{
const char *readDraw = drawing ? "Draw" : "Read";
+ if (ctx->Extensions.EXT_packed_depth_stencil
+ && type == GL_UNSIGNED_INT_24_8_EXT
+ && format != GL_DEPTH_STENCIL_EXT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw);
+ return GL_TRUE;
+ }
+
/* basic combinations test */
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -112,13 +120,6 @@ error_check_format_type(GLcontext *ctx, GLenum format, GLenum type,
return GL_TRUE;
}
- /* XXX might have to move this to the top of the function */
- if (type == GL_UNSIGNED_INT_24_8_EXT && format != GL_DEPTH_STENCIL_EXT) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw);
- return GL_TRUE;
- }
-
/* no errors */
return GL_FALSE;
}