Mesa (master): mesa: simplify _mesa_update_draw_buffers()

Brian Paul brianp at kemper.freedesktop.org
Mon Aug 11 15:47:09 UTC 2014


Module: Mesa
Branch: master
Commit: 904ed3b3153a73b601085ed22d2ba3693812b1cf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=904ed3b3153a73b601085ed22d2ba3693812b1cf

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Aug  8 15:10:31 2014 -0600

mesa: simplify _mesa_update_draw_buffers()

There's no need to copy the array of DrawBuffer enums to a temp array.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/mesa/main/buffers.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 6b4fac9..140cf6e 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -567,16 +567,11 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers,
 void
 _mesa_update_draw_buffers(struct gl_context *ctx)
 {
-   GLenum buffers[MAX_DRAW_BUFFERS];
-   GLuint i;
-
    /* should be a window system FBO */
    assert(_mesa_is_winsys_fbo(ctx->DrawBuffer));
 
-   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->Const.MaxDrawBuffers,
+                     ctx->Color.DrawBuffer, NULL);
 }
 
 




More information about the mesa-commit mailing list