From: Brian Paul Date: Tue, 23 Feb 2016 20:46:28 +0000 (-0700) Subject: mesa: replace for loop with bitshifting in supported_buffer_bitmask() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c95d5c5f6fbfe4a96276e67ed279562b33432fb5;p=mesa.git mesa: replace for loop with bitshifting in supported_buffer_bitmask() Reviewed-by: Rob Clark Reviewed-by: Roland Scheidegger --- diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 70c2a21b473..26dafd1b786 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -58,10 +58,7 @@ supported_buffer_bitmask(const struct gl_context *ctx, if (_mesa_is_user_fbo(fb)) { /* A user-created renderbuffer */ - GLuint i; - for (i = 0; i < ctx->Const.MaxColorAttachments; i++) { - mask |= (BUFFER_BIT_COLOR0 << i); - } + mask = ((1 << ctx->Const.MaxColorAttachments) - 1) << BUFFER_COLOR0; } else { /* A window system framebuffer */