case GL_FLOAT:
case GL_INT:
case GL_UNSIGNED_INT:
- case GL_UNSIGNED_INT64_ARB:
return GL_FALSE;
+ case GL_UNSIGNED_INT64_ARB:
case GL_DOUBLE:
return GL_TRUE;
default:
}
+static inline void
+vbo_set_vertex_format(struct gl_vertex_format* vertex_format,
+ GLubyte size, GLenum16 type)
+{
+ _mesa_set_vertex_format(vertex_format, size, type, GL_RGBA, GL_FALSE,
+ vbo_attrtype_to_integer_flag(type),
+ vbo_attrtype_to_double_flag(type));
+}
+
+
/**
* Return default component values for the given format.
* The return type is an array of fi_types, because that's how we declare
{
static const GLfloat default_float[4] = { 0, 0, 0, 1 };
static const GLint default_int[4] = { 0, 0, 0, 1 };
+ static const GLdouble default_double[4] = { 0, 0, 0, 1 };
+ static const uint64_t default_uint64[4] = { 0, 0, 0, 1 };
switch (format) {
case GL_FLOAT:
case GL_INT:
case GL_UNSIGNED_INT:
return (fi_type *)default_int;
+ case GL_DOUBLE:
+ return (fi_type *)default_double;
+ case GL_UNSIGNED_INT64_ARB:
+ return (fi_type *)default_uint64;
default:
unreachable("Bad vertex format");
return NULL;
{
const GLboolean integer = vbo_attrtype_to_integer_flag(type);
const GLboolean doubles = vbo_attrtype_to_double_flag(type);
+
+ if (doubles)
+ size /= 2;
_mesa_update_array_format(ctx, vao, attr, size, type, GL_RGBA,
GL_FALSE, integer, doubles, offset);
/* Ptr for userspace arrays.
* to the VAO. But but that is done already unconditionally in
* _mesa_update_array_format called above.
*/
- assert((vao->NewArrays | ~vao->_Enabled) & VERT_BIT(attr));
+ assert((vao->NewArrays | ~vao->Enabled) & VERT_BIT(attr));
vao->VertexAttrib[attr].Ptr = ADD_POINTERS(buffer_offset, offset);
}