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

Method acquireDevice

Source/Falcor/Testing/UnitTest.cpp:92–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 DevicePool(Device::Desc defaultDesc) : mDefaultDesc(defaultDesc) {}
91
92 ref<Device> acquireDevice(Device::Type deviceType)
93 {
94 std::lock_guard<std::mutex> lock(mMutex);
95 auto& devices = mDevices[deviceType];
96 if (devices.empty())
97 {
98 Device::Desc desc = mDefaultDesc;
99 desc.type = deviceType;
100 return make_ref<Device>(desc);
101 }
102 auto device = devices.back();
103 devices.pop_back();
104 return device;
105 }
106
107 void releaseDevice(ref<Device>&& device)
108 {

Callers 1

runTestFunction · 0.80

Calls 2

backMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected