Modified `create_external_buffer` so that it use the `conv::map_external_memory_type` function.
@@ -2339,46 +2339,7 @@ impl d::Device<B> for super::Device {
let mut vk_external_memory_types = vk::ExternalMemoryHandleTypeFlags::empty();
for external_memory_type in external_memory_types {
- vk_external_memory_types |= match external_memory_type {
- #[cfg(unix)]
- external_memory::ExternalMemoryType::OpaqueFd => {
- vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD
- }
- #[cfg(windows)]
- external_memory::ExternalMemoryType::OpaqueWin32 => {
- vk::ExternalMemoryHandleTypeFlags::OPAQUE_WIN32
- }
- #[cfg(windows)]
- external_memory::ExternalMemoryType::OpaqueWin32Kmt => {
- vk::ExternalMemoryHandleTypeFlags::OPAQUE_WIN32_KMT
- }
- #[cfg(windows)]
- external_memory::ExternalMemoryType::D3D11Texture => {
- vk::ExternalMemoryHandleTypeFlags::D3D11_TEXTURE
- }
- #[cfg(windows)]
- external_memory::ExternalMemoryType::D3D11TextureKmt => {
- vk::ExternalMemoryHandleTypeFlags::D3D11_TEXTURE_KMT
- }
- #[cfg(windows)]
- external_memory::ExternalMemoryType::D3D12Heap => {
- vk::ExternalMemoryHandleTypeFlags::D3D12_HEAP
- }
- #[cfg(windows)]
- external_memory::ExternalMemoryType::D3D12Resource => {
- vk::ExternalMemoryHandleTypeFlags::D3D12_RESOURCE
- }
- #[cfg(any(target_os = "linux", target_os = "android"))]
- external_memory::ExternalMemoryType::DmaBuf => {
- vk::ExternalMemoryHandleTypeFlags::DMA_BUF_EXT
- }
- #[cfg(target_os = "android")]
- external_memory::ExternalMemoryType::AndroidHardwareBuffer => {
- vk::ExternalMemoryHandleTypeFlags::ANDROID_HARDWARE_BUFFER_ANDROID
- }
- external_memory::ExternalMemoryType::HostAllocation=>vk::ExternalMemoryHandleTypeFlags::HOST_ALLOCATION_EXT,
- external_memory::ExternalMemoryType::HostMappedForeignMemory=>vk::ExternalMemoryHandleTypeFlags::HOST_MAPPED_FOREIGN_MEMORY_EXT,
- };
+ vk_external_memory_types |= conv::map_external_memory_type(external_memory_type);
}
let mut external_buffer_ci = vk::ExternalMemoryBufferCreateInfo::builder()
