diff options
author | Dylan Noblesmith <nobled@dreamwidth.org> | 2013-07-19 22:24:11 +0000 |
---|---|---|
committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2013-09-16 15:57:27 +0000 |
commit | 7508252a5d88cf2b2f2772e866e4fcb09bd64558 (patch) | |
tree | 0fb72bb0b2ea0a1fd18237792b8268cf32533a24 | |
parent | ef5ef8c308b0aee4ea185b7166bd9e87fd36454c (diff) |
mesa: don't hardcode ctx->DrawBuffer in _mesa_drawbuffers
-rw-r--r-- | src/mesa/main/buffers.c | 14 | ||||
-rw-r--r-- | src/mesa/main/buffers.h | 4 | ||||
-rw-r--r-- | src/mesa/main/framebuffer.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index aaa5e55e46..947f159716 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -252,7 +252,7 @@ draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb, GLenum buffer, } /* if we get here, there's no error so set new state */ - _mesa_drawbuffers(ctx, 1, &buffer, &destMask); + _mesa_drawbuffers(ctx, fb, 1, &buffer, &destMask); /* @@ -428,7 +428,7 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, } /* OK, if we get here, there were no errors so set the new state */ - _mesa_drawbuffers(ctx, n, buffers, destMask); + _mesa_drawbuffers(ctx, fb, n, buffers, destMask); /* @@ -490,12 +490,13 @@ updated_drawbuffers(struct gl_context *ctx) /** * Helper function to set the GL_DRAW_BUFFER state in the context and - * current FBO. Called via glDrawBuffer(), glDrawBuffersARB() + * given FBO. Called via glDrawBuffer(), glDrawBuffersARB() * * All error checking will have been done prior to calling this function * so nothing should go wrong at this point. * * \param ctx current context + * \param fb framebuffer object to work on * \param n number of color outputs to set * \param buffers array[n] of colorbuffer names, like GL_LEFT. * \param destMask array[n] of BUFFER_BIT_* bitmasks which correspond to the @@ -503,10 +504,9 @@ updated_drawbuffers(struct gl_context *ctx) * BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT). */ void -_mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, - const GLbitfield *destMask) +_mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb, + GLuint n, const GLenum *buffers, const GLbitfield *destMask) { - struct gl_framebuffer *fb = ctx->DrawBuffer; GLbitfield mask[MAX_DRAW_BUFFERS]; GLuint buf; @@ -604,7 +604,7 @@ _mesa_update_draw_buffers(struct gl_context *ctx) for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) buffers[i] = ctx->Color.DrawBuffer[i]; - _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL); + _mesa_drawbuffers(ctx, ctx->DrawBuffer, ctx->Const.MaxDrawBuffers, buffers, NULL); } diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index ccfa7030c7..df7d4508fb 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -45,8 +45,8 @@ extern void GLAPIENTRY _mesa_DrawBuffers(GLsizei n, const GLenum *buffers); extern void -_mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, - const GLbitfield *destMask); +_mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb, + GLuint n, const GLenum *buffers, const GLbitfield *destMask); extern void _mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb, diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 2fad458806..024309f513 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -624,7 +624,7 @@ update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) * context state (GL_READ_BUFFER too). */ if (fb->ColorDrawBuffer[0] != ctx->Color.DrawBuffer[0]) { - _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, + _mesa_drawbuffers(ctx, ctx->DrawBuffer, ctx->Const.MaxDrawBuffers, ctx->Color.DrawBuffer, NULL); } } |