diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-04-14 02:25:35 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-04-14 02:25:35 +0000 |
commit | 730b26556bf0f82385059dfcb7488f4b9b349118 (patch) | |
tree | 3eec2cddc1cce71344d4e58c005c02f033b6b58d | |
parent | 61608ecfa70fffaee083c37ce2b0138566b0e327 (diff) |
When popping GL_DRAW_BUFFER state, need to re-do error checking since
validity depends on whether a window-system FBO or user-created FBO is
currently bound. glPopAttrib() may generate GL_INVALID_OPERATION because
of this.
-rw-r--r-- | src/mesa/main/attrib.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 2eef729469..d15f9f714d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -848,8 +848,19 @@ _mesa_PopAttrib(void) (GLboolean) (color->ColorMask[1] != 0), (GLboolean) (color->ColorMask[2] != 0), (GLboolean) (color->ColorMask[3] != 0)); - _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, - color->DrawBuffer, NULL); + /* Call the API_level functions, not _mesa_drawbuffers() since + * we need to do error checking on the pop'd GL_DRAW_BUFFER. + * Ex: if GL_FRONT were pushed, but we're popping with a user + * FBO bound, GL_FRONT will be illegal and we'll need to + * record that error. Per OpenGL ARB decision. + */ + if (ctx->Extensions.ARB_draw_buffers) { + _mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers, + color->DrawBuffer); + } + else { + _mesa_DrawBuffer(color->DrawBuffer[0]); + } _mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled); _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef); _mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled); |