return;
}
- if (!newObj->EverBound) {
- /* 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 = GL_TRUE;
- newObj->EverBound = GL_TRUE;
- }
+ newObj->EverBound = GL_TRUE;
}
if (ctx->Array.DrawMethod == DRAW_ARRAYS) {
/* skip Name */
/* skip RefCount */
- /* In theory must be the same anyway, but on recreate make sure it matches */
- dest->ARBsemantics = src->ARBsemantics;
-
for (i = 0; i < ARRAY_SIZE(src->VertexAttrib); i++) {
_mesa_copy_client_array(ctx, &dest->_VertexAttrib[i], &src->_VertexAttrib[i]);
_mesa_copy_vertex_attrib_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
struct gl_array_attrib *dest,
struct gl_array_attrib *src)
{
+ bool is_vao_name_zero = src->VAO->Name == 0;
+
/* The ARB_vertex_array_object spec says:
*
* "BindVertexArray fails and an INVALID_OPERATION error is generated
* DeleteVertexArrays."
*
* Therefore popping a deleted VAO cannot magically recreate it.
- *
- * The semantics of objects created using APPLE_vertex_array_objects behave
- * differently. These objects expect to be recreated by pop. Alas.
*/
- const bool arb_vao = (src->VAO->Name != 0
- && src->VAO->ARBsemantics);
-
- if (arb_vao && !_mesa_IsVertexArray(src->VAO->Name))
+ if (!is_vao_name_zero && !_mesa_IsVertexArray(src->VAO->Name))
return;
_mesa_BindVertexArray(src->VAO->Name);
/* Restore or recreate the buffer objects by the names ... */
- if (!arb_vao
- || src->ArrayBufferObj->Name == 0
- || _mesa_IsBuffer(src->ArrayBufferObj->Name)) {
+ if (is_vao_name_zero || src->ArrayBufferObj->Name == 0 ||
+ _mesa_IsBuffer(src->ArrayBufferObj->Name)) {
/* ... and restore its content */
copy_array_attrib(ctx, dest, src, false);
copy_array_attrib(ctx, dest, src, true);
}
- if (!arb_vao
- || src->VAO->IndexBufferObj->Name == 0
- || _mesa_IsBuffer(src->VAO->IndexBufferObj->Name))
+ if (is_vao_name_zero || src->VAO->IndexBufferObj->Name == 0 ||
+ _mesa_IsBuffer(src->VAO->IndexBufferObj->Name))
_mesa_BindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB,
src->VAO->IndexBufferObj->Name);
}
GLchar *Label; /**< GL_KHR_debug */
- /**
- * 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;
-
/**
* Has this array object been bound?
*/
* to the ARRAY_BUFFER buffer object binding point (see section
* 2.9.6), and the pointer argument is not NULL."
*/
- if (ptr != NULL && vao->ARBsemantics &&
+ if (ptr != NULL && vao != ctx->Array.DefaultVAO &&
!_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-VBO array)", func);
return;