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

Method getNativeHandle

Source/Falcor/Core/API/Device.cpp:1181–1205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179}
1180
1181NativeHandle Device::getNativeHandle(uint32_t index) const
1182{
1183 gfx::IDevice::InteropHandles gfxInteropHandles = {};
1184 FALCOR_GFX_CALL(mGfxDevice->getNativeDeviceHandles(&gfxInteropHandles));
1185
1186#if FALCOR_HAS_D3D12
1187 if (getType() == Device::Type::D3D12)
1188 {
1189 if (index == 0)
1190 return NativeHandle(reinterpret_cast<ID3D12Device*>(gfxInteropHandles.handles[0].handleValue));
1191 }
1192#endif
1193#if FALCOR_HAS_VULKAN
1194 if (getType() == Device::Type::Vulkan)
1195 {
1196 if (index == 0)
1197 return NativeHandle(reinterpret_cast<VkInstance>(gfxInteropHandles.handles[0].handleValue));
1198 else if (index == 1)
1199 return NativeHandle(reinterpret_cast<VkPhysicalDevice>(gfxInteropHandles.handles[1].handleValue));
1200 else if (index == 2)
1201 return NativeHandle(reinterpret_cast<VkDevice>(gfxInteropHandles.handles[2].handleValue));
1202 }
1203#endif
1204 return {};
1205}
1206
1207// Debug log message from ray tracing validation system
1208#if FALCOR_NVAPI_AVAILABLE && FALCOR_HAS_D3D12

Callers

nothing calls this directly

Calls 2

NativeHandleClass · 0.85
getTypeFunction · 0.70

Tested by

no test coverage detected