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

Method getNativeHandle

Source/Falcor/Core/API/ResourceViews.cpp:41–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39{
40
41NativeHandle ResourceView::getNativeHandle() const
42{
43 FALCOR_ASSERT(mpDevice != nullptr && mpResource != nullptr);
44 gfx::InteropHandle gfxNativeHandle = {};
45 FALCOR_GFX_CALL(mGfxResourceView->getNativeHandle(&gfxNativeHandle));
46#if FALCOR_HAS_D3D12
47 if (mpDevice->getType() == Device::Type::D3D12)
48 return NativeHandle(D3D12_CPU_DESCRIPTOR_HANDLE{gfxNativeHandle.handleValue});
49#endif
50#if FALCOR_HAS_VULKAN
51 if (mpDevice->getType() == Device::Type::Vulkan)
52 {
53 if (mpResource)
54 {
55 if (mpResource->getType() == Resource::Type::Buffer)
56 {
57 if (mGfxResourceView->getViewDesc()->format == gfx::Format::Unknown)
58 return NativeHandle(reinterpret_cast<VkBuffer>(gfxNativeHandle.handleValue));
59 else
60 return NativeHandle(reinterpret_cast<VkBufferView>(gfxNativeHandle.handleValue));
61 }
62 else
63 {
64 return NativeHandle(reinterpret_cast<VkImageView>(gfxNativeHandle.handleValue));
65 }
66 }
67 }
68#endif
69 return {};
70}
71
72ResourceView::~ResourceView()
73{

Callers

nothing calls this directly

Calls 2

NativeHandleClass · 0.85
getTypeMethod · 0.45

Tested by

no test coverage detected