Khronos Public Bugzilla
Bug 768 - glDeleteBuffers and glTexBuffer
glDeleteBuffers and glTexBuffer
Status: RESOLVED FIXED
Product: OpenGL
Classification: Unclassified
Component: API Specification
4.3
PC Windows
: P3 normal
: ---
Assigned To: Jon Leech
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-11 08:48 PST by Alfonse
Modified: 2013-09-11 20:46 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alfonse 2013-01-11 08:48:09 PST
Section 5.1.3 of the GL 4.3 specification states:

"A buffer, texture, or renderbuffer object is in use while it is attached to any container object or bound to a context bind point in any context."

So if a buffer object is attached to a VAO with `glVertexAttribPointer`, the buffer will continue to exist so long as the VAO attachment is not changed. Similarly, if it is bound to an indexed target of the current context, it will remain bound, per various rules.

However, the text above only specifies what happens if a buffer is bound to a container object or to the context. Textures are not container objects. So what happens to a buffer texture if the buffer object attached to it is deleted? Does it still count as "in use"?
Comment 1 Jon Leech 2013-07-09 16:25:26 PDT
That's a good catch. The model underlying this is reference counting,
although we don't say so in so many terms, because people's implementations
can differ. A buffer texture certainly counts as a reference on the
buffer; in fact issue (5) in ARB_texture_buffer_object says so explicitly,
but we need a bit more language in the spec about it. I will put it on
the agenda for clarification.
Comment 2 Jon Leech 2013-09-11 20:46:42 PDT
We did add some language to 4.4 (at the last minute before SIGGRAPH
release) which added views of an object's data store as an "in use" /
reference count. Hopefully that adequately addressed this issue.