30 likes | 178 Views
This document explains the behavior of orphaned texture objects in OpenGL, focusing on the binding and deletion processes across multiple contexts. It outlines how to bind texture IDs in different contexts, the effects of deleting objects, and the implications of binding context changes on object availability. Key points include the distinction between deletion and unbinding, the concept of reference counting, and the atomic nature of certain OpenGL commands. Understanding these behaviors is crucial for managing texture resources effectively in graphics programming.
E N D
Orphan Object (Bill) Current texture object behavior: • Bind ID in context 1 • Bind same ID in context 2 and start rendering against it • Delete object in context 1. • Object un-bound from all texture stages ONLY in context 1. • Object is deleted once no longer bound in any context. • After deletion name will be marked as available. • In single context case, delete will un-bind, refcount goes to zero, therefore is deleted.
Orphan Object (Pat) Current texture object behavior: • Bind ID in context 1 • Bind same ID in context 2 and start rendering against it • Delete object in context 1. • Object un-bound from all texture stages ONLY in context 1. • Object ID no longer exists. Therefore same ID is available to create a new object. • Old object is deleted once no longer bound in any context. (But cannot be referenced by ID anymore) • In single context case, delete will un-bind, refcount goes to zero, therefore is deleted.
GLX 1.3 spec • The results of changing a texture object while another context is using it are undefined. • All modifications to shared context state as a result of executing glBindTexture are atomic. Also, a texture object will not be deleted until it is no longer bound to any rendering context. • In general, OpenGL commands are not guaranteed to be atomic. The operation of glEndList and glDeleteLists are exceptions: modifications to the shared context state as a result of executing glEndList or glDeleteLists are atomic.