aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/buffers.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-06-17 07:56:55 +0200
committermarha <marha@users.sourceforge.net>2011-06-17 07:56:55 +0200
commit9bea2bf9069195c27824644331d4a275ea3df9f4 (patch)
tree06dcb54a49f89b8ceca5d10aa99351998071615a /mesalib/src/mesa/main/buffers.c
parentaa5db0c31378f6dee271da6cf24f7e4da55fe9ef (diff)
parent743d2ab8160b84c62106467c50ec3871adbf5e75 (diff)
downloadvcxsrv-9bea2bf9069195c27824644331d4a275ea3df9f4.tar.gz
vcxsrv-9bea2bf9069195c27824644331d4a275ea3df9f4.tar.bz2
vcxsrv-9bea2bf9069195c27824644331d4a275ea3df9f4.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/main/context.c mesalib/src/mesa/main/fbobject.c
Diffstat (limited to 'mesalib/src/mesa/main/buffers.c')
-rw-r--r--mesalib/src/mesa/main/buffers.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/buffers.c b/mesalib/src/mesa/main/buffers.c
index 63f53e2b0..a75c9c2e7 100644
--- a/mesalib/src/mesa/main/buffers.c
+++ b/mesalib/src/mesa/main/buffers.c
@@ -462,6 +462,27 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers,
/**
+ * Update the current drawbuffer's _ColorDrawBufferIndex[] list, etc.
+ * from the context's Color.DrawBuffer[] state.
+ * Use when changing contexts.
+ */
+void
+_mesa_update_draw_buffers(struct gl_context *ctx)
+{
+ GLenum buffers[MAX_DRAW_BUFFERS];
+ GLuint i;
+
+ /* should be a window system FBO */
+ assert(ctx->DrawBuffer->Name == 0);
+
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++)
+ buffers[i] = ctx->Color.DrawBuffer[i];
+
+ _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL);
+}
+
+
+/**
* Like \sa _mesa_drawbuffers(), this is a helper function for setting
* GL_READ_BUFFER state in the context and current FBO.
* \param ctx the rendering context