(BITFIELD64_MASK((b) + (count)) & ~BITFIELD64_MASK(b))
+#define GET_COLORMASK_BIT(mask, buf, chan) (((mask) >> (4 * (buf) + (chan))) & 0x1)
+#define GET_COLORMASK(mask, buf) (((mask) >> (4 * (buf))) & 0xf)
+
+
/**
* \name Some forward type declarations
*/
GLuint ClearIndex; /**< Index for glClear */
union gl_color_union ClearColor; /**< Color for glClear, unclamped */
GLuint IndexMask; /**< Color index write mask */
- GLubyte ColorMask[MAX_DRAW_BUFFERS][4]; /**< Each flag is 0xff or 0x0 */
+
+ /** 4 colormask bits per draw buffer, max 8 draw buffers. 4*8 = 32 bits */
+ GLbitfield ColorMask;
GLenum16 DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */
struct gl_texture_image
{
GLint InternalFormat; /**< Internal format as given by the user */
- GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
+ GLenum16 _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
* GL_LUMINANCE, GL_LUMINANCE_ALPHA,
* GL_INTENSITY, GL_DEPTH_COMPONENT or
* GL_DEPTH_STENCIL_EXT only. Used for
GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - p in spec) */
GLint CropRect[4]; /**< GL_OES_draw_texture */
- GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */
+ GLenum16 Swizzle[4]; /**< GL_EXT_texture_swizzle */
GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */
GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */
GLboolean _BaseComplete; /**< Is the base texture level valid? */
*/
struct gl_buffer_object
{
- simple_mtx_t Mutex;
GLint RefCount;
GLuint Name;
GLchar *Label; /**< GL_KHR_debug */
struct gl_buffer_mapping Mappings[MAP_COUNT];
/** Memoization of min/max index computations for static index buffers */
+ simple_mtx_t MinMaxCacheMutex;
struct hash_table *MinMaxCache;
unsigned MinMaxCacheHitIndices;
unsigned MinMaxCacheMissIndices;
};
+/**
+ * Enum for defining the mapping for the position/generic0 attribute.
+ *
+ * Do not change the order of the values as these are used as
+ * array indices.
+ */
+typedef enum
+{
+ ATTRIBUTE_MAP_MODE_IDENTITY, /**< 1:1 mapping */
+ ATTRIBUTE_MAP_MODE_POSITION, /**< get position and generic0 from position */
+ ATTRIBUTE_MAP_MODE_GENERIC0, /**< get position and generic0 from generic0 */
+ ATTRIBUTE_MAP_MODE_MAX /**< for sizing arrays */
+} gl_attribute_map_mode;
+
+
/**
* Attributes to describe a vertex array.
*
* Derived vertex attribute arrays
*
* This is a legacy data structure created from gl_array_attributes and
- * gl_vertex_buffer_binding, for compatibility with existing driver code.
+ * gl_vertex_buffer_binding, only used by the VBO module at this time.
*/
- struct gl_vertex_array _VertexAttrib[VERT_ATTRIB_MAX];
+ struct gl_vertex_array _VertexArray[VERT_ATTRIB_MAX];
/** Vertex attribute arrays */
struct gl_array_attributes VertexAttrib[VERT_ATTRIB_MAX];
/** Mask of VERT_BIT_* values indicating which arrays are enabled */
GLbitfield _Enabled;
+ /** Denotes the way the position/generic0 attribute is mapped */
+ gl_attribute_map_mode _AttributeMapMode;
+
/** Mask of VERT_BIT_* values indicating changed/dirty arrays */
GLbitfield NewArrays;
*/
struct gl_query_object
{
- GLenum Target; /**< The query target, when active */
+ GLenum16 Target; /**< The query target, when active */
GLuint Id; /**< hash table ID/name */
GLchar *Label; /**< GL_KHR_debug */
GLuint64EXT Result; /**< the counter */