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

Method getNativeHandle

Source/Falcor/Core/API/Resource.cpp:207–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207NativeHandle Resource::getNativeHandle() const
208{
209 gfx::InteropHandle gfxNativeHandle = {};
210 FALCOR_GFX_CALL(getGfxResource()->getNativeResourceHandle(&gfxNativeHandle));
211#if FALCOR_HAS_D3D12
212 if (mpDevice->getType() == Device::Type::D3D12)
213 return NativeHandle(reinterpret_cast<ID3D12Resource*>(gfxNativeHandle.handleValue));
214#endif
215#if FALCOR_HAS_VULKAN
216 if (mpDevice->getType() == Device::Type::Vulkan)
217 {
218 if (mType == Type::Buffer)
219 return NativeHandle(reinterpret_cast<VkBuffer>(gfxNativeHandle.handleValue));
220 else
221 return NativeHandle(reinterpret_cast<VkImage>(gfxNativeHandle.handleValue));
222 }
223#endif
224 return {};
225}
226
227void Resource::breakStrongReferenceToDevice()
228{

Callers

nothing calls this directly

Calls 2

NativeHandleClass · 0.85
getTypeMethod · 0.45

Tested by

no test coverage detected