From: Brian Paul Date: Thu, 20 Aug 2009 14:10:14 +0000 (-0600) Subject: mesa: add GL_DEPTH_STENCIL to glCopyPixels error check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39ec4a9253197c4507d53ce9a3c1d8963d8f5cea;p=mesa.git mesa: add GL_DEPTH_STENCIL to glCopyPixels error check Plus, add a comment about 'type' error checking. See bug 19087. --- diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 6d31f32443a..67311f71a26 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -152,7 +152,14 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, return; } - if (type != GL_COLOR && type != GL_DEPTH && type != GL_STENCIL) { + /* Note: more detailed 'type' checking is done by the + * _mesa_source/dest_buffer_exists() calls below. That's where we + * check if the stencil buffer exists, etc. + */ + if (type != GL_COLOR && + type != GL_DEPTH && + type != GL_STENCIL && + type != GL_DEPTH_STENCIL) { _mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels(type=%s)", _mesa_lookup_enum_by_nr(type)); return;