diff options
Diffstat (limited to 'src/mesa/main/buffers.c')
-rw-r--r-- | src/mesa/main/buffers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index bb856882da2..d98c015bb24 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -37,6 +37,7 @@ #include "fbobject.h" #include "mtypes.h" #include "util/bitscan.h" +#include "util/u_math.h" #define BAD_MASK ~0u @@ -468,7 +469,7 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n, * For OpenGL 4.x we check that behaviour. For any previous version we * keep considering it wrong (as INVALID_ENUM). */ - if (_mesa_bitcount(destMask[output]) > 1) { + if (util_bitcount(destMask[output]) > 1) { if (_mesa_is_winsys_fbo(fb) && ctx->Version >= 40 && buffers[output] == GL_BACK) { if (n != 1) { @@ -722,7 +723,7 @@ _mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb, * (ex: glDrawBuffer(GL_FRONT_AND_BACK)). * Otherwise, destMask[x] can only have one bit set. */ - if (n > 0 && _mesa_bitcount(destMask[0]) > 1) { + if (n > 0 && util_bitcount(destMask[0]) > 1) { GLuint count = 0, destMask0 = destMask[0]; while (destMask0) { const gl_buffer_index bufIndex = u_bit_scan(&destMask0); @@ -741,7 +742,7 @@ _mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb, if (destMask[buf]) { gl_buffer_index bufIndex = ffs(destMask[buf]) - 1; /* only one bit should be set in the destMask[buf] field */ - assert(_mesa_bitcount(destMask[buf]) == 1); + assert(util_bitcount(destMask[buf]) == 1); if (fb->_ColorDrawBufferIndexes[buf] != bufIndex) { updated_drawbuffers(ctx, fb); fb->_ColorDrawBufferIndexes[buf] = bufIndex; |