summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/buffers.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2016-06-09 06:35:34 +0200
committerMathias Fröhlich <[email protected]>2016-06-14 05:19:10 +0200
commited2dae86aef759a6858f56d77eba77895bec5020 (patch)
tree9550383ac3d0df82ac574019f6bc9e0173497d0c /src/mesa/main/buffers.c
parentc3b66566760dd44eaeed9e4df13687dc3ee69bd9 (diff)
mesa: Make use of u_bit_scan{,64}.
Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/buffers.c')
-rw-r--r--src/mesa/main/buffers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index a28c5831576..e8aedde8777 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -36,6 +36,7 @@
#include "enums.h"
#include "fbobject.h"
#include "mtypes.h"
+#include "util/bitscan.h"
#define BAD_MASK ~0u
@@ -595,13 +596,12 @@ _mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
if (n > 0 && _mesa_bitcount(destMask[0]) > 1) {
GLuint count = 0, destMask0 = destMask[0];
while (destMask0) {
- GLint bufIndex = ffs(destMask0) - 1;
+ const int bufIndex = u_bit_scan(&destMask0);
if (fb->_ColorDrawBufferIndexes[count] != bufIndex) {
updated_drawbuffers(ctx, fb);
fb->_ColorDrawBufferIndexes[count] = bufIndex;
}
count++;
- destMask0 &= ~(1 << bufIndex);
}
fb->ColorDrawBuffer[0] = buffers[0];
fb->_NumColorDrawBuffers = count;