| 205 | } |
| 206 | |
| 207 | NativeHandle 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 | |
| 227 | void Resource::breakStrongReferenceToDevice() |
| 228 | { |
nothing calls this directly
no test coverage detected