mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-18 08:20:29 +01:00
mesa: Make use of u_bit_scan{,64}.
Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Brian Paul <brianp@vmware.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
This commit is contained in:
parent
c3b6656676
commit
ed2dae86ae
2 changed files with 5 additions and 5 deletions
|
|
@ -52,6 +52,7 @@
|
|||
#include "mtypes.h"
|
||||
#include "varray.h"
|
||||
#include "main/dispatch.h"
|
||||
#include "util/bitscan.h"
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -342,13 +343,12 @@ _mesa_update_vao_client_arrays(struct gl_context *ctx,
|
|||
GLbitfield64 arrays = vao->NewArrays;
|
||||
|
||||
while (arrays) {
|
||||
const int attrib = u_bit_scan64(&arrays);
|
||||
|
||||
struct gl_client_array *client_array;
|
||||
struct gl_vertex_attrib_array *attrib_array;
|
||||
struct gl_vertex_buffer_binding *buffer_binding;
|
||||
|
||||
GLint attrib = ffsll(arrays) - 1;
|
||||
arrays ^= BITFIELD64_BIT(attrib);
|
||||
|
||||
attrib_array = &vao->VertexAttrib[attrib];
|
||||
buffer_binding = &vao->VertexBinding[attrib_array->VertexBinding];
|
||||
client_array = &vao->_VertexAttrib[attrib];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue