Skip to content

Commit

Permalink
Avoid Linux-only dependencies on other OSs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Rockenzahn Gallegos committed Mar 11, 2023
1 parent 53289b8 commit 0355d80
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
6 changes: 5 additions & 1 deletion vulkano/src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ pub use self::{
attachment::AttachmentImage,
immutable::ImmutableImage,
layout::{ImageDescriptorLayouts, ImageLayout},
storage::{StorageImage, SubresourceData},
storage::StorageImage,
swapchain::SwapchainImage,
sys::ImageError,
traits::{ImageAccess, ImageInner},
usage::ImageUsage,
view::{ImageViewAbstract, ImageViewType},
};

#[cfg(target_os = "linux")]
pub use self::storage::SubresourceData;

use crate::{
format::Format,
macros::{vulkan_bitflags, vulkan_bitflags_enum, vulkan_enum},
Expand Down
23 changes: 18 additions & 5 deletions vulkano/src/image/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,35 @@ use super::{
use crate::{
device::{Device, DeviceOwned, Queue},
format::Format,
image::{sys::ImageCreateInfo, view::ImageView, ImageFormatInfo, ImageTiling},
image::{sys::ImageCreateInfo, view::ImageView, ImageFormatInfo},
memory::{
allocator::{
AllocationCreateInfo, AllocationType, MemoryAlloc, MemoryAllocatePreference,
AllocationCreateInfo, AllocationType, MemoryAllocatePreference,
MemoryAllocator, MemoryUsage,
},
DedicatedAllocation, DeviceMemory, DeviceMemoryError, ExternalMemoryHandleType,
ExternalMemoryHandleTypes, MemoryAllocateFlags, MemoryAllocateInfo,
DedicatedAllocation, DeviceMemoryError, ExternalMemoryHandleType,
ExternalMemoryHandleTypes,
},
sync::Sharing,
DeviceSize,
};
use ash::vk::{ImageDrmFormatModifierExplicitCreateInfoEXT, SubresourceLayout};
use smallvec::SmallVec;

#[cfg(target_os = "linux")]
use std::os::unix::prelude::{FromRawFd, IntoRawFd, RawFd};
#[cfg(target_os = "linux")]
use ash::vk::{ImageDrmFormatModifierExplicitCreateInfoEXT, SubresourceLayout};
#[cfg(target_os = "linux")]
use crate::{
image::ImageTiling,
memory::{
allocator::MemoryAlloc,
DeviceMemory,
MemoryAllocateFlags,
MemoryAllocateInfo
}
};

use std::{
fs::File,
hash::{Hash, Hasher},
Expand Down

0 comments on commit 0355d80

Please sign in to comment.