From a5743fdf7d0779b84463f38fe730fa2a0098f340 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 8 Aug 2014 07:46:45 -0600 Subject: mesa: define and use ALL_TYPE_BITS in varray.c code Reviewed-by: Ian Romanick Reviewed-by: Roland Scheidegger --- src/mesa/main/varray.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 0356858796a..14544491ca7 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -46,21 +46,22 @@ /** Used to indicate which GL datatypes are accepted by each of the * glVertex/Color/Attrib/EtcPointer() functions. */ -#define BOOL_BIT 0x1 -#define BYTE_BIT 0x2 -#define UNSIGNED_BYTE_BIT 0x4 -#define SHORT_BIT 0x8 -#define UNSIGNED_SHORT_BIT 0x10 -#define INT_BIT 0x20 -#define UNSIGNED_INT_BIT 0x40 -#define HALF_BIT 0x80 -#define FLOAT_BIT 0x100 -#define DOUBLE_BIT 0x200 -#define FIXED_ES_BIT 0x400 -#define FIXED_GL_BIT 0x800 -#define UNSIGNED_INT_2_10_10_10_REV_BIT 0x1000 -#define INT_2_10_10_10_REV_BIT 0x2000 -#define UNSIGNED_INT_10F_11F_11F_REV_BIT 0x4000 +#define BOOL_BIT (1 << 0) +#define BYTE_BIT (1 << 1) +#define UNSIGNED_BYTE_BIT (1 << 2) +#define SHORT_BIT (1 << 3) +#define UNSIGNED_SHORT_BIT (1 << 4) +#define INT_BIT (1 << 5) +#define UNSIGNED_INT_BIT (1 << 6) +#define HALF_BIT (1 << 7) +#define FLOAT_BIT (1 << 8) +#define DOUBLE_BIT (1 << 9) +#define FIXED_ES_BIT (1 << 10) +#define FIXED_GL_BIT (1 << 11) +#define UNSIGNED_INT_2_10_10_10_REV_BIT (1 << 12) +#define INT_2_10_10_10_REV_BIT (1 << 13) +#define UNSIGNED_INT_10F_11F_11F_REV_BIT (1 << 14) +#define ALL_TYPE_BITS ((1 << 15) - 1) /** Convert GL datatype enum into a _BIT value seen above */ @@ -185,7 +186,7 @@ vertex_binding_divisor(struct gl_context *ctx, GLuint bindingIndex, static GLbitfield get_legal_types_mask(const struct gl_context *ctx) { - GLbitfield legalTypesMask = ~0u; /* all */ + GLbitfield legalTypesMask = ALL_TYPE_BITS; if (_mesa_is_gles(ctx)) { legalTypesMask &= ~(FIXED_GL_BIT | -- cgit v1.2.3