mesa: simplify _mesa_update_draw_buffers()
authorBrian Paul <brianp@vmware.com>
Fri, 8 Aug 2014 21:10:31 +0000 (15:10 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 11 Aug 2014 15:44:51 +0000 (09:44 -0600)
There's no need to copy the array of DrawBuffer enums to a temp array.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/main/buffers.c

index 6b4fac9f58d5858265b7982c20ff2df54ba3219a..140cf6e82eb9c2bcf9b8ef012b3c600072af854c 100644 (file)
@@ -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);
 }