summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-08-08 07:46:45 -0600
committerBrian Paul <[email protected]>2014-08-11 09:37:50 -0600
commita5743fdf7d0779b84463f38fe730fa2a0098f340 (patch)
treeee2f013f9fb4f42c0be2a8919e33905375d6e942
parent288f8876228d2d61dca309b832105488daf5b0e8 (diff)
mesa: define and use ALL_TYPE_BITS in varray.c code
Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/mesa/main/varray.c33
1 files 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 <type>_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 |