summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-04-18 16:28:16 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-04-18 16:28:16 +0000
commit9c84dfe1566a71471c97b50d2453707264b1cca6 (patch)
treebc1531cc5ffad3ec0c1061d66667494e68453f1f
parent8d86325516edf1ba06d2e847d077b1295cc5b739 (diff)
downloadmesa-9c84dfe1566a71471c97b50d2453707264b1cca6.tar.gz
glPopAttrib() GL_DRAW_BUFFER state fix, from trunk
-rw-r--r--src/mesa/main/attrib.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 2eef7294691..4afd982314c 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -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);