You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GL 4.6 core / GLES 3.2 section 5.1.2 has language:
"When a buffer ... object is successfully deleted, it is unbound from any bind points it is bound to in the current context, and detached from any attachments of container objects that are bound to the current context, as described for DeleteBuffers ... . If the object binding was established with other related state ... all such related state are restored to default values by the automatic unbind."
It would be great if there was more explicit language for what is included in "all such related state" for each object type / binding point. For example, the specification as is only indirectly suggests that enable/disable and divisor is not part of state that should be reset for vertex attrib pointers. It would also be great to list the side effects in object deletion API function.
The text was updated successfully, but these errors were encountered:
I believe the "other related state" depends on the type of buffer being deleted. For example, if it was bound to a GL_UNIFORM_BUFFER binding point then the "other related state" can be found in the Uniform Buffer Binding State table, which includes GL_UNIFORM_BUFFER_START and GL_UNIFORM_BUFFER_SIZE. Does that seem reasonable?
There probably is some room for improvement in the spec to be more explicit about the state that's getting restored to default values. We're definitely open to suggestions if you have an idea for improvement.
My issue is with glVertexAttribPointer*(). It touches size, stride, type, normalized, pointer, buffer_binding, integer for vertex attrib array in VAO. I peeked (very quickly only) in mesa sources and it reset some but not all of these to defaults on auto-unbind. I suspect different drivers/vendors might do different things. This would be a potential problem when trying to cache GL state, at least in GLES where some apps still use client side data. Explicitly listing state to reset on auto-unbind would also make it clear which state is not reset. In case of VAO vertex attrib pointer state, divisor and enabled state is not.
GL 4.6 core / GLES 3.2 section 5.1.2 has language:
"When a buffer ... object is successfully deleted, it is unbound from any bind points it is bound to in the current context, and detached from any attachments of container objects that are bound to the current context, as described for DeleteBuffers ... . If the object binding was established with other related state ... all such related state are restored to default values by the automatic unbind."
It would be great if there was more explicit language for what is included in "all such related state" for each object type / binding point. For example, the specification as is only indirectly suggests that enable/disable and divisor is not part of state that should be reset for vertex attrib pointers. It would also be great to list the side effects in object deletion API function.
The text was updated successfully, but these errors were encountered: