_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
return;
}
+
+ /* The "Interactions with APPLE_vertex_array_object" section of the
+ * GL_ARB_vertex_array_object spec says:
+ *
+ * "The first bind call, either BindVertexArray or
+ * BindVertexArrayAPPLE, determines the semantic of the object."
+ */
+ newObj->ARBsemantics = genRequired;
save_array_object(ctx, newObj);
}
}
* \param vboOnly Will arrays have to reside in VBOs?
*/
static void
-gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays,
- GLboolean vboOnly)
+gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays)
{
GLuint first;
GLint i;
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE");
return;
}
- obj->VBOonly = vboOnly;
save_array_object(ctx, obj);
arrays[i] = first + i;
}
_mesa_GenVertexArrays(GLsizei n, GLuint *arrays)
{
GET_CURRENT_CONTEXT(ctx);
- gen_vertex_arrays(ctx, n, arrays, GL_TRUE);
+ gen_vertex_arrays(ctx, n, arrays);
}
_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays)
{
GET_CURRENT_CONTEXT(ctx);
- gen_vertex_arrays(ctx, n, arrays, GL_FALSE);
+ gen_vertex_arrays(ctx, n, arrays);
}
/* skip RefCount */
/* In theory must be the same anyway, but on recreate make sure it matches */
- dest->VBOonly = src->VBOonly;
+ dest->ARBsemantics = src->ARBsemantics;
for (i = 0; i < Elements(src->VertexAttrib); i++)
_mesa_copy_client_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
GLint RefCount;
_glthread_Mutex Mutex;
- GLboolean VBOonly; /**< require all arrays to live in VBOs? */
+
+ /**
+ * Does the VAO use ARB semantics or Apple semantics?
+ *
+ * There are several ways in which ARB_vertex_array_object and
+ * APPLE_vertex_array_object VAOs have differing semantics. At the very
+ * least,
+ *
+ * - ARB VAOs require that all array data be sourced from vertex buffer
+ * objects, but Apple VAOs do not.
+ *
+ * - ARB VAOs require that names come from GenVertexArrays.
+ *
+ * This flag notes which behavior governs this VAO.
+ */
+ GLboolean ARBsemantics;
/** Vertex attribute arrays */
struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX];