MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / newObject

Function newObject

Source/Falcor/Core/API/FencedPool.h:60–81  ·  view source on GitHub ↗

* Return an object. * @return An object, or throws an exception on failure. */

Source from the content-addressed store, hash-verified

58 * @return An object, or throws an exception on failure.
59 */
60 ObjectType newObject()
61 {
62 // Retire the active object
63 Data data;
64 data.alloc = mActiveObject;
65 data.timestamp = mpFence->getSignaledValue();
66 mQueue.push(data);
67
68 // The queue is sorted based on time. Check if the first object is free
69 data = mQueue.front();
70 if (data.timestamp < mpFence->getCurrentValue())
71 {
72 mQueue.pop();
73 }
74 else
75 {
76 data.alloc = createObject();
77 }
78
79 mActiveObject = data.alloc;
80 return mActiveObject;
81 }
82
83private:
84 FencedPool(ref<Fence> pFence, NewObjectFuncType newFunc, void* pUserData) : mNewObjFunc(newFunc), mpFence(pFence), mpUserData(pUserData)

Callers

nothing calls this directly

Calls 4

createObjectFunction · 0.85
pushMethod · 0.80
frontMethod · 0.80
getCurrentValueMethod · 0.80

Tested by

no test coverage detected