[Mesa-dev] [PATCH 9/9] mesa: replace for loop with bitshifting in supported_buffer_bitmask()

Brian Paul brianp at vmware.com
Tue Feb 23 23:45:25 UTC 2016


---
 src/mesa/main/buffers.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 70c2a21..6a6584e 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 */
-- 
1.9.1



More information about the mesa-dev mailing list