typeBit = type_to_bit(ctx, type);
if (typeBit == 0x0 || (typeBit & legalTypesMask) == 0x0) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)",
- func, _mesa_lookup_enum_by_nr(type));
+ func, _mesa_enum_to_string(type));
return false;
}
if (bgra_error) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(size=GL_BGRA and type=%s)",
- func, _mesa_lookup_enum_by_nr(type));
+ func, _mesa_enum_to_string(type));
return false;
}
"glPointSizePointer(ES 1.x only)");
return;
}
-
+
update_array(ctx, "glPointSizePointer", VERT_ATTRIB_POINT_SIZE,
legalTypes, 1, 1,
1, type, stride, GL_FALSE, GL_FALSE, GL_FALSE, ptr);
}
goto error;
case GL_VERTEX_ATTRIB_BINDING:
- if (_mesa_is_desktop_gl(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx)) {
return array->VertexBinding - VERT_ATTRIB_GENERIC0;
}
goto error;
case GL_VERTEX_ATTRIB_RELATIVE_OFFSET:
- if (_mesa_is_desktop_gl(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx)) {
return array->RelativeOffset;
}
goto error;
return NULL;
}
- assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) <
+ ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
FLUSH_CURRENT(ctx, 0);
return ctx->Current.Attrib[VERT_ATTRIB_GENERIC(index)];
GET_CURRENT_CONTEXT(ctx);
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
- const GLdouble *v = (const GLdouble *)get_current_attrib(ctx, index, "glGetVertexAttribLdv");
+ const GLdouble *v =
+ (const GLdouble *)get_current_attrib(ctx, index,
+ "glGetVertexAttribLdv");
if (v != NULL) {
params[0] = v[0];
params[1] = v[1];
return;
}
- assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) <
+ ARRAY_SIZE(ctx->Array.VAO->VertexAttrib));
- *pointer = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr;
+ *pointer = (GLvoid *)
+ ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr;
}
* required to be the same, so in practice this doesn't matter.
*/
if (index >= ctx->Const.MaxVertexAttribBindings) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexArrayIndexed64iv("
- "index %d >= the value of GL_MAX_VERTEX_ATTRIB_BINDINGS (%d))",
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexArrayIndexed64iv(index"
+ "%d >= the value of GL_MAX_VERTEX_ATTRIB_BINDINGS (%d))",
index, ctx->Const.MaxVertexAttribBindings);
return;
}
* GL_ARB_vertex_attrib_binding
*/
static void
-vertex_array_vertex_buffer(struct gl_context *ctx, struct gl_vertex_array_object *vao,
+vertex_array_vertex_buffer(struct gl_context *ctx,
+ struct gl_vertex_array_object *vao,
GLuint bindingIndex, GLuint buffer, GLintptr offset,
GLsizei stride, const char *func)
{
return;
}
- if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
+ if (((ctx->API == API_OPENGL_CORE && ctx->Version >= 44) || _mesa_is_gles31(ctx)) &&
stride > ctx->Const.MaxVertexAttribStride) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > "
"GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride);
return;
}
- if (buffer == vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
+ if (buffer ==
+ vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
vbo = vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj;
} else if (buffer != 0) {
vbo = _mesa_lookup_bufferobj(ctx, buffer);
* Otherwise, we fall back to the same compat profile behavior as other
* object references (automatically gen it).
*/
- if (!_mesa_handle_bind_buffer_gen(ctx, GL_ARRAY_BUFFER, buffer,
- &vbo, func))
+ if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func))
return;
} else {
/* The ARB_vertex_attrib_binding spec says:
* "An INVALID_OPERATION error is generated if no vertex array object
* is bound."
*/
- if (ctx->API == API_OPENGL_CORE &&
+ if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBindVertexBuffer(No array object bound)");
* is an oversight. In the OpenGL 4.3 (Core Profile) spec, it applies
* to all three functions.
*/
- if (ctx->API == API_OPENGL_CORE &&
+ if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(No array object bound)", func);
* "An INVALID_OPERATION error is generated if no vertex array object
* is bound."
*/
- if (ctx->API == API_OPENGL_CORE &&
+ if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexAttribBinding(No array object bound)");
* "An INVALID_OPERATION error is generated if no vertex array object
* is bound."
*/
- if (ctx->API == API_OPENGL_CORE &&
+ if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexBindingDivisor(No array object bound)");
void GLAPIENTRY
-_mesa_VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingIndex, GLuint divisor)
+_mesa_VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingIndex,
+ GLuint divisor)
{
struct gl_vertex_array_object *vao;
GET_CURRENT_CONTEXT(ctx);
else
fprintf(stderr, " %s: ", name);
fprintf(stderr, "Ptr=%p, Type=%s, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %lu)\n",
- array->Ptr, _mesa_lookup_enum_by_nr(array->Type), array->Size,
+ array->Ptr, _mesa_enum_to_string(array->Type), array->Size,
array->_ElementSize, array->StrideB, array->BufferObj->Name,
(unsigned long) array->BufferObj->Size);
}
/**
* Initialize vertex array state for given context.
*/
-void
+void
_mesa_init_varray(struct gl_context *ctx)
{
ctx->Array.DefaultVAO = ctx->Driver.NewArrayObject(ctx, 0);
/**
* Free vertex array state for given context.
*/
-void
+void
_mesa_free_varray_data(struct gl_context *ctx)
{
_mesa_HashDeleteAll(ctx->Array.Objects, delete_arrayobj_cb, ctx);