From 3d61c2e778e5592a52eef21fab6cc301b54f449e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 1 Oct 2005 16:02:11 +0000 Subject: [PATCH] move around some error checking --- src/mesa/main/drawpix.c | 15 ++++++++------- 1 file 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; } -- 2.30.2