**************************************************************************/
+#include "util/u_format_r11g11b10f.h"
+
/* float */
#define ATTR1FV( A, V ) ATTR( A, 1, GL_FLOAT, (V)[0], 0, 0, 1 )
#define ATTR2FV( A, V ) ATTR( A, 2, GL_FLOAT, (V)[0], (V)[1], 0, 1 )
} else { \
ATTRI10_##val((attr), (arg)); \
} \
+ } else if ((type) == GL_UNSIGNED_INT_10F_11F_11F_REV) { \
+ float res[4]; \
+ r11g11b10f_to_float3((arg), res); \
+ ATTR##val##FV((attr), res); \
} else \
ERROR(GL_INVALID_VALUE); \
} while(0)
ATTR4FV(index, v);
}
+
#define ERROR_IF_NOT_PACKED_TYPE(ctx, type, func) \
if (type != GL_INT_2_10_10_10_REV && type != GL_UNSIGNED_INT_2_10_10_10_REV) { \
_mesa_error(ctx, GL_INVALID_ENUM, "%s(type)", func); \
return; \
}
+/* Extended version of ERROR_IF_NOT_PACKED_TYPE which also
+ * accepts GL_UNSIGNED_INT_10F_11F_11F_REV.
+ *
+ * Only used for VertexAttribP[123]ui[v]; VertexAttribP4* cannot use this type,
+ * and neither can legacy vertex attribs.
+ */
+#define ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, func) \
+ if (type != GL_INT_2_10_10_10_REV && type != GL_UNSIGNED_INT_2_10_10_10_REV && \
+ type != GL_UNSIGNED_INT_10F_11F_11F_REV) { \
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(type)", func); \
+ return; \
+ }
+
static void GLAPIENTRY
TAG(VertexP2ui)(GLenum type, GLuint value)
{
GLuint value)
{
GET_CURRENT_CONTEXT(ctx);
- ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP1ui");
+ ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP1ui");
ATTR_UI_INDEX(ctx, 1, type, normalized, index, value);
}
GLuint value)
{
GET_CURRENT_CONTEXT(ctx);
- ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP2ui");
+ ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP2ui");
ATTR_UI_INDEX(ctx, 2, type, normalized, index, value);
}
GLuint value)
{
GET_CURRENT_CONTEXT(ctx);
- ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP3ui");
+ ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP3ui");
ATTR_UI_INDEX(ctx, 3, type, normalized, index, value);
}
const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP1uiv");
+ ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP1uiv");
ATTR_UI_INDEX(ctx, 1, type, normalized, index, *value);
}
const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP2uiv");
+ ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP2uiv");
ATTR_UI_INDEX(ctx, 2, type, normalized, index, *value);
}
const GLuint *value)
{
GET_CURRENT_CONTEXT(ctx);
- ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP3uiv");
+ ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP3uiv");
ATTR_UI_INDEX(ctx, 3, type, normalized, index, *value);
}