diff options
author | Mathias Fröhlich <[email protected]> | 2011-12-22 20:12:20 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2011-12-28 07:35:23 +0100 |
commit | 50e0091a9d70f9e6383ad322d4df7576bd7c38f7 (patch) | |
tree | 1f93b04bcc889f1e059ebe833870dce064917ffb | |
parent | b50d250e02457f367c195ee1808b061e0dfe2d00 (diff) |
mesa: Convert RENDERINPUTS* macros to GLbitfield64.
Signed-off-by: Mathias Froehlich <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/mesa/main/mtypes.h | 6 | ||||
-rw-r--r-- | src/mesa/tnl/t_context.h | 26 |
2 files changed, 20 insertions, 12 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 7068d5aff4d..107371e5299 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -56,6 +56,12 @@ typedef GLuint64 GLbitfield64; /** Set a single bit */ #define BITFIELD64_BIT(b) ((GLbitfield64)1 << (b)) +/** Set all bits up to excluding bit b */ +#define BITFIELD64_MASK(b) \ + ((b) == 64 ? (~(GLbitfield64)0) : BITFIELD64_BIT(b) - 1) +/** Set count bits starting from bit b */ +#define BITFIELD64_RANGE(b, count) \ + (BITFIELD64_MASK((b) + (count)) & ~BITFIELD64_MASK(b)) /** diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 36b10435441..3b7d4468055 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -50,7 +50,7 @@ #define _T_CONTEXT_H #include "main/glheader.h" -#include "main/bitset.h" +#include "main/imports.h" #include "main/mtypes.h" #include "math/m_vector.h" @@ -162,6 +162,9 @@ enum { #define _TNL_FIRST_MAT _TNL_ATTRIB_MAT_FRONT_AMBIENT /* GENERIC0 */ #define _TNL_LAST_MAT _TNL_ATTRIB_MAT_BACK_INDEXES /* GENERIC11 */ +/* Number of available texture attributes */ +#define _TNL_NUM_TEX 8 + /* Number of available generic attributes */ #define _TNL_NUM_GENERIC 16 @@ -480,17 +483,16 @@ struct tnl_device_driver }; -#define DECLARE_RENDERINPUTS(name) BITSET64_DECLARE(name, _TNL_ATTRIB_MAX) -#define RENDERINPUTS_COPY BITSET64_COPY -#define RENDERINPUTS_EQUAL BITSET64_EQUAL -#define RENDERINPUTS_ZERO BITSET64_ZERO -#define RENDERINPUTS_ONES BITSET64_ONES -#define RENDERINPUTS_TEST BITSET64_TEST -#define RENDERINPUTS_SET BITSET64_SET -#define RENDERINPUTS_CLEAR BITSET64_CLEAR -#define RENDERINPUTS_TEST_RANGE BITSET64_TEST_RANGE -#define RENDERINPUTS_SET_RANGE BITSET64_SET_RANGE -#define RENDERINPUTS_CLEAR_RANGE BITSET64_CLEAR_RANGE +#define DECLARE_RENDERINPUTS(name) GLbitfield64 name +#define RENDERINPUTS_COPY(x, y) do { (x) = (y); } while (0) +#define RENDERINPUTS_EQUAL(x, y) ((x) == (y)) +#define RENDERINPUTS_ZERO(x) do { (x) = 0; } while (0) +#define RENDERINPUTS_ONES(x) do { (x) = ~(GLbitfield64)0; } while (0) +#define RENDERINPUTS_TEST(x, b) (((x) & BITFIELD64_BIT(b)) != 0) +#define RENDERINPUTS_SET(x, b) ((x) |= BITFIELD64_BIT(b)) +#define RENDERINPUTS_CLEAR(x, b) ((x) &= ~BITFIELD64_BIT(b)) +#define RENDERINPUTS_TEST_RANGE(x, b, e) \ + (((x) & BITFIELD64_RANGE((b), (e) - (b) + 1)) != 0) /** |