| 39 | { |
| 40 | |
| 41 | NativeHandle 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 | |
| 72 | ResourceView::~ResourceView() |
| 73 | { |
nothing calls this directly
no test coverage detected