diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/arrayobj.c | 14 | ||||
-rw-r--r-- | src/mesa/main/enable.c | 2 | ||||
-rw-r--r-- | src/mesa/main/ff_fragment_shader.cpp | 2 | ||||
-rw-r--r-- | src/mesa/main/ffvertex_prog.c | 2 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 20 | ||||
-rw-r--r-- | src/mesa/main/state.c | 2 | ||||
-rw-r--r-- | src/mesa/main/state.h | 2 | ||||
-rw-r--r-- | src/mesa/main/varray.c | 2 |
8 files changed, 28 insertions, 18 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 18d6d8008c1..d9a65ba4105 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -252,7 +252,7 @@ init_array(struct gl_context *ctx, binding->Offset = 0; binding->Stride = array->_ElementSize; binding->BufferObj = NULL; - binding->_BoundArrays = BITFIELD64_BIT(index); + binding->_BoundArrays = BITFIELD_BIT(index); /* Vertex array buffers */ _mesa_reference_buffer_object(ctx, &binding->BufferObj, @@ -314,10 +314,10 @@ void _mesa_update_vao_client_arrays(struct gl_context *ctx, struct gl_vertex_array_object *vao) { - GLbitfield64 arrays = vao->NewArrays; + GLbitfield arrays = vao->NewArrays; while (arrays) { - const int attrib = u_bit_scan64(&arrays); + const int attrib = u_bit_scan(&arrays); struct gl_vertex_array *client_array = &vao->_VertexAttrib[attrib]; const struct gl_array_attributes *attrib_array = &vao->VertexAttrib[attrib]; @@ -334,13 +334,13 @@ bool _mesa_all_varyings_in_vbos(const struct gl_vertex_array_object *vao) { /* Walk those enabled arrays that have the default vbo attached */ - GLbitfield64 mask = vao->_Enabled & ~vao->VertexAttribBufferMask; + GLbitfield mask = vao->_Enabled & ~vao->VertexAttribBufferMask; while (mask) { /* Do not use u_bit_scan64 as we can walk multiple * attrib arrays at once */ - const int i = ffsll(mask) - 1; + const int i = ffs(mask) - 1; const struct gl_array_attributes *attrib_array = &vao->VertexAttrib[i]; const struct gl_vertex_buffer_binding *buffer_binding = @@ -368,10 +368,10 @@ bool _mesa_all_buffers_are_unmapped(const struct gl_vertex_array_object *vao) { /* Walk the enabled arrays that have a vbo attached */ - GLbitfield64 mask = vao->_Enabled & vao->VertexAttribBufferMask; + GLbitfield mask = vao->_Enabled & vao->VertexAttribBufferMask; while (mask) { - const int i = ffsll(mask) - 1; + const int i = ffs(mask) - 1; const struct gl_array_attributes *attrib_array = &vao->VertexAttrib[i]; const struct gl_vertex_buffer_binding *buffer_binding = diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 8e99f2504f1..c859a7ae1c7 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -64,7 +64,7 @@ static void client_state(struct gl_context *ctx, GLenum cap, GLboolean state) { struct gl_vertex_array_object *vao = ctx->Array.VAO; - GLbitfield64 flag; + GLbitfield flag; GLboolean *var; switch (cap) { diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp index 2b924f6d101..83541a269ac 100644 --- a/src/mesa/main/ff_fragment_shader.cpp +++ b/src/mesa/main/ff_fragment_shader.cpp @@ -180,7 +180,7 @@ static GLbitfield filter_fp_input_mask( GLbitfield fp_inputs, GLbitfield possible_inputs = 0; /* _NEW_VARYING_VP_INPUTS */ - GLbitfield64 varying_inputs = ctx->varying_vp_inputs; + GLbitfield varying_inputs = ctx->varying_vp_inputs; /* These get generated in the setup routine regardless of the * vertex program: diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 85f8f24d830..44fbf4fb8a1 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -68,7 +68,7 @@ struct state_key { unsigned texture_enabled_global:1; unsigned fragprog_inputs_read:12; - GLbitfield64 varying_vp_inputs; + GLbitfield varying_vp_inputs; struct { unsigned light_enabled:1; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4682e02fc85..9d704c1c158 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -56,6 +56,16 @@ extern "C" { #endif +/** Set a single bit */ +#define BITFIELD_BIT(b) ((GLbitfield)1 << (b)) +/** Set all bits up to excluding bit b */ +#define BITFIELD_MASK(b) \ + ((b) == 32 ? (~(GLbitfield)0) : BITFIELD_BIT(b) - 1) +/** Set count bits starting from bit b */ +#define BITFIELD_RANGE(b, count) \ + (BITFIELD_MASK((b) + (count)) & ~BITFIELD_MASK(b)) + + /** * \name 64-bit extension of GLbitfield. */ @@ -1507,7 +1517,7 @@ struct gl_vertex_buffer_binding GLsizei Stride; /**< User-specified stride */ GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */ struct gl_buffer_object *BufferObj; /**< GL_ARB_vertex_buffer_object */ - GLbitfield64 _BoundArrays; /**< Arrays bound to this binding point */ + GLbitfield _BoundArrays; /**< Arrays bound to this binding point */ }; @@ -1544,13 +1554,13 @@ struct gl_vertex_array_object struct gl_vertex_buffer_binding BufferBinding[VERT_ATTRIB_MAX]; /** Mask indicating which vertex arrays have vertex buffer associated. */ - GLbitfield64 VertexAttribBufferMask; + GLbitfield VertexAttribBufferMask; /** Mask of VERT_BIT_* values indicating which arrays are enabled */ - GLbitfield64 _Enabled; + GLbitfield _Enabled; /** Mask of VERT_BIT_* values indicating changed/dirty arrays */ - GLbitfield64 NewArrays; + GLbitfield NewArrays; /** The index buffer (also known as the element array buffer in OpenGL). */ struct gl_buffer_object *IndexBufferObj; @@ -4948,7 +4958,7 @@ struct gl_context GLboolean ViewportInitialized; /**< has viewport size been initialized? */ - GLbitfield64 varying_vp_inputs; /**< mask of VERT_BIT_* flags */ + GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */ /** \name Derived state */ GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 7aec98e5784..7a9732d37b2 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -414,7 +414,7 @@ _mesa_update_state( struct gl_context *ctx ) */ void _mesa_set_varying_vp_inputs( struct gl_context *ctx, - GLbitfield64 varying_inputs ) + GLbitfield varying_inputs ) { if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h index b719f392965..9d4591790ae 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -39,7 +39,7 @@ _mesa_update_state_locked(struct gl_context *ctx); extern void -_mesa_set_varying_vp_inputs(struct gl_context *ctx, GLbitfield64 varying_inputs); +_mesa_set_varying_vp_inputs(struct gl_context *ctx, GLbitfield varying_inputs); extern void diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 99347244891..31f1c8339df 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -138,7 +138,7 @@ vertex_attrib_binding(struct gl_context *ctx, struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex]; if (array->BufferBindingIndex != bindingIndex) { - const GLbitfield64 array_bit = VERT_BIT(attribIndex); + const GLbitfield array_bit = VERT_BIT(attribIndex); if (_mesa_is_bufferobj(vao->BufferBinding[bindingIndex].BufferObj)) vao->VertexAttribBufferMask |= array_bit; |