TYPE_ENUM,
TYPE_ENUM_2,
TYPE_BOOLEAN,
+ TYPE_UBYTE,
+ TYPE_SHORT,
TYPE_BIT_0,
TYPE_BIT_1,
TYPE_BIT_2,
GLint value_int_4[4];
GLint64 value_int64;
GLenum value_enum;
+ GLubyte value_ubyte;
+ GLshort value_short;
/* Sigh, see GL_COMPRESSED_TEXTURE_FORMATS_ARB handling */
struct {
#define CONTEXT_MATRIX(field) CONTEXT_FIELD(field, TYPE_MATRIX)
#define CONTEXT_MATRIX_T(field) CONTEXT_FIELD(field, TYPE_MATRIX_T)
+/* Vertex array fields */
#define ARRAY_INT(field) ARRAY_FIELD(field, TYPE_INT)
#define ARRAY_ENUM(field) ARRAY_FIELD(field, TYPE_ENUM)
#define ARRAY_ENUM16(field) ARRAY_FIELD(field, TYPE_ENUM16)
#define ARRAY_BOOL(field) ARRAY_FIELD(field, TYPE_BOOLEAN)
+#define ARRAY_UBYTE(field) ARRAY_FIELD(field, TYPE_UBYTE)
+#define ARRAY_SHORT(field) ARRAY_FIELD(field, TYPE_SHORT)
#define EXT(f) \
offsetof(struct gl_extensions, f)
return sizeof(GLenum) * 2;
case TYPE_BOOLEAN:
return sizeof(GLboolean);
+ case TYPE_UBYTE:
+ return sizeof(GLubyte);
+ case TYPE_SHORT:
+ return sizeof(GLshort);
case TYPE_BIT_0:
case TYPE_BIT_1:
case TYPE_BIT_2:
params[0] = ((GLboolean*) p)[0];
break;
+ case TYPE_UBYTE:
+ params[0] = INT_TO_BOOLEAN(((GLubyte *) p)[0]);
+ break;
+
+ case TYPE_SHORT:
+ params[0] = INT_TO_BOOLEAN(((GLshort *) p)[0]);
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) p;
for (i = 0; i < 16; i++)
params[0] = BOOLEAN_TO_FLOAT(*(GLboolean*) p);
break;
+ case TYPE_UBYTE:
+ params[0] = (GLfloat) ((GLubyte *) p)[0];
+ break;
+
+ case TYPE_SHORT:
+ params[0] = (GLfloat) ((GLshort *) p)[0];
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) p;
for (i = 0; i < 16; i++)
params[0] = BOOLEAN_TO_INT(*(GLboolean*) p);
break;
+ case TYPE_UBYTE:
+ params[0] = ((GLubyte *) p)[0];
+ break;
+
+ case TYPE_SHORT:
+ params[0] = ((GLshort *) p)[0];
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) p;
for (i = 0; i < 16; i++)
params[0] = *(GLboolean*) p;
break;
+ case TYPE_UBYTE:
+ params[0] = ((GLubyte *) p)[0];
+ break;
+
+ case TYPE_SHORT:
+ params[0] = ((GLshort *) p)[0];
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) p;
for (i = 0; i < 16; i++)
case TYPE_ENUM:
case TYPE_ENUM_2:
case TYPE_BOOLEAN:
+ case TYPE_UBYTE:
+ case TYPE_SHORT:
case TYPE_FLOAT:
case TYPE_FLOATN:
case TYPE_FLOAT_2:
params[0] = BOOLEAN_TO_FLOAT(v.value_bool);
break;
+ case TYPE_UBYTE:
+ params[0] = (GLfloat) v.value_ubyte;
+ break;
+
+ case TYPE_SHORT:
+ params[0] = (GLfloat) v.value_short;
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) &v;
for (i = 0; i < 16; i++)
params[0] = (GLdouble) BOOLEAN_TO_FLOAT(v.value_bool);
break;
+ case TYPE_UBYTE:
+ params[0] = (GLdouble) v.value_ubyte;
+ break;
+
+ case TYPE_SHORT:
+ params[0] = (GLdouble) v.value_short;
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) &v;
for (i = 0; i < 16; i++)
case TYPE_ENUM:
case TYPE_ENUM_2:
case TYPE_BOOLEAN:
+ case TYPE_UBYTE:
+ case TYPE_SHORT:
case TYPE_FLOAT:
case TYPE_FLOATN:
case TYPE_FLOAT_2:
params[0] = BOOLEAN_TO_FIXED(((GLboolean*) p)[0]);
break;
+ case TYPE_UBYTE:
+ params[0] = INT_TO_FIXED(((GLubyte *) p)[0]);
+ break;
+
+ case TYPE_SHORT:
+ params[0] = INT_TO_FIXED(((GLshort *) p)[0]);
+ break;
+
case TYPE_MATRIX:
m = *(GLmatrix **) p;
for (i = 0; i < 16; i++)
[ "TEXTURE_MATRIX", "LOC_CUSTOM, TYPE_MATRIX, 0, extra_valid_texture_unit" ],
[ "TEXTURE_STACK_DEPTH", "LOC_CUSTOM, TYPE_INT, 0, extra_valid_texture_unit" ],
[ "VERTEX_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_POS].Enabled), NO_EXTRA" ],
- [ "VERTEX_ARRAY_SIZE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_POS].Size), NO_EXTRA" ],
+ [ "VERTEX_ARRAY_SIZE", "ARRAY_UBYTE(VertexAttrib[VERT_ATTRIB_POS].Size), NO_EXTRA" ],
[ "VERTEX_ARRAY_TYPE", "ARRAY_ENUM16(VertexAttrib[VERT_ATTRIB_POS].Type), NO_EXTRA" ],
- [ "VERTEX_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_POS].Stride), NO_EXTRA" ],
+ [ "VERTEX_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_POS].Stride), NO_EXTRA" ],
[ "NORMAL_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_NORMAL].Enabled), NO_EXTRA" ],
[ "NORMAL_ARRAY_TYPE", "ARRAY_ENUM16(VertexAttrib[VERT_ATTRIB_NORMAL].Type), NO_EXTRA" ],
- [ "NORMAL_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_NORMAL].Stride), NO_EXTRA" ],
+ [ "NORMAL_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_NORMAL].Stride), NO_EXTRA" ],
[ "COLOR_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR0].Enabled), NO_EXTRA" ],
- [ "COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
+ [ "COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_UBYTE, 0, NO_EXTRA" ],
[ "COLOR_ARRAY_TYPE", "ARRAY_ENUM16(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA" ],
- [ "COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA" ],
+ [ "COLOR_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY", "LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_array_attributes, Enabled), NO_EXTRA" ],
- [ "TEXTURE_COORD_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_array_attributes, Size), NO_EXTRA" ],
+ [ "TEXTURE_COORD_ARRAY_SIZE", "LOC_CUSTOM, TYPE_UBYTE, offsetof(struct gl_array_attributes, Size), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY_TYPE", "LOC_CUSTOM, TYPE_ENUM16, offsetof(struct gl_array_attributes, Type), NO_EXTRA" ],
- [ "TEXTURE_COORD_ARRAY_STRIDE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_array_attributes, Stride), NO_EXTRA" ],
+ [ "TEXTURE_COORD_ARRAY_STRIDE", "LOC_CUSTOM, TYPE_SHORT, offsetof(struct gl_array_attributes, Stride), NO_EXTRA" ],
# GL_ARB_multitexture
[ "MAX_TEXTURE_UNITS", "CONTEXT_INT(Const.MaxTextureUnits), NO_EXTRA" ],
# OES_point_size_array
[ "POINT_SIZE_ARRAY_OES", "ARRAY_FIELD(VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled, TYPE_BOOLEAN), NO_EXTRA" ],
[ "POINT_SIZE_ARRAY_TYPE_OES", "ARRAY_FIELD(VertexAttrib[VERT_ATTRIB_POINT_SIZE].Type, TYPE_ENUM16), NO_EXTRA" ],
- [ "POINT_SIZE_ARRAY_STRIDE_OES", "ARRAY_FIELD(VertexAttrib[VERT_ATTRIB_POINT_SIZE].Stride, TYPE_INT), NO_EXTRA" ],
+ [ "POINT_SIZE_ARRAY_STRIDE_OES", "ARRAY_FIELD(VertexAttrib[VERT_ATTRIB_POINT_SIZE].Stride, TYPE_SHORT), NO_EXTRA" ],
[ "POINT_SIZE_ARRAY_BUFFER_BINDING_OES", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
]},
[ "COLOR_ARRAY_COUNT_EXT", "CONST(0), NO_EXTRA" ],
[ "INDEX_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled), NO_EXTRA" ],
[ "INDEX_ARRAY_TYPE", "ARRAY_ENUM16(VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Type), NO_EXTRA" ],
- [ "INDEX_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Stride), NO_EXTRA" ],
+ [ "INDEX_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Stride), NO_EXTRA" ],
[ "INDEX_ARRAY_COUNT_EXT", "CONST(0), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY_COUNT_EXT", "CONST(0), NO_EXTRA" ],
[ "EDGE_FLAG_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled), NO_EXTRA" ],
- [ "EDGE_FLAG_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_EDGEFLAG].Stride), NO_EXTRA" ],
+ [ "EDGE_FLAG_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_EDGEFLAG].Stride), NO_EXTRA" ],
[ "EDGE_FLAG_ARRAY_COUNT_EXT", "CONST(0), NO_EXTRA" ],
# GL_ARB_texture_compression
[ "CURRENT_SECONDARY_COLOR", "CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR1][0], TYPE_FLOATN_4), extra_flush_current" ],
[ "SECONDARY_COLOR_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR1].Enabled), NO_EXTRA" ],
[ "SECONDARY_COLOR_ARRAY_TYPE", "ARRAY_ENUM16(VertexAttrib[VERT_ATTRIB_COLOR1].Type), NO_EXTRA" ],
- [ "SECONDARY_COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride), NO_EXTRA" ],
- [ "SECONDARY_COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
+ [ "SECONDARY_COLOR_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride), NO_EXTRA" ],
+ [ "SECONDARY_COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_UBYTE, 0, NO_EXTRA" ],
# GL_EXT_fog_coord
[ "CURRENT_FOG_COORDINATE", "CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]), extra_flush_current" ],
[ "FOG_COORDINATE_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_FOG].Enabled), NO_EXTRA" ],
[ "FOG_COORDINATE_ARRAY_TYPE", "ARRAY_ENUM16(VertexAttrib[VERT_ATTRIB_FOG].Type), NO_EXTRA" ],
- [ "FOG_COORDINATE_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_FOG].Stride), NO_EXTRA" ],
+ [ "FOG_COORDINATE_ARRAY_STRIDE", "ARRAY_SHORT(VertexAttrib[VERT_ATTRIB_FOG].Stride), NO_EXTRA" ],
[ "FOG_COORDINATE_SOURCE", "CONTEXT_ENUM16(Fog.FogCoordinateSource), NO_EXTRA" ],
# GL_NV_fog_distance