glaveSnapshot: Reorganize creation/insertion and deletion of objects
authorPeter Lohrmann <peterl@valvesoftware.com>
Mon, 30 Mar 2015 19:58:50 +0000 (12:58 -0700)
committerPeter Lohrmann <peterl@valvesoftware.com>
Mon, 30 Mar 2015 21:27:32 +0000 (14:27 -0700)
commitc5425bb1caaeafa5643fc6094e83c07622c35d7b
treea82a058e3b093504ad45a21350d32a17a2f89523
parent137eae1e6525b056cbd270c397dc345a7a23050a
glaveSnapshot: Reorganize creation/insertion and deletion of objects

* Return value of api's Create* calls is now ensured to be XGL_SUCCESS before attempting to track the object.
* Created objects are now inserted into a snapshot's global and object lists, then the node is returned so that the caller can populate additional information in the pStruct member if needed.
* The list of devices now uses the GLV_VK_SNAPSHOT_LL_NODE because device object nodes will be linked into the global list and object lists to help avoid duplication of data.
* When a created object needs to get deleted, snapshot_remove_object(..) will search for the object in the global list and remove the node from both lists before returning a pointer to the node (or NULL if the object was not in the global list, meaning we didn't see the creation). The caller should delete the pStruct member as appropriate and then delete the node itself. If the creation of the object was not captured, the caller should add the object to the deleted object list.
* Deleted objects (whose creation was not recorded) now get tracked using a different linked-list struct than other objects. There is a lot less known information related to a deleted object, so there's no need to use the larger struct.
layers/glave_snapshot.c
layers/glave_snapshot.h