Skip to content

Commit

Permalink
Fix compile error for unimplemented metal backend.
Browse files Browse the repository at this point in the history
Fix windows doc test error.
  • Loading branch information
Uniformbuffer3 committed Jun 3, 2021
1 parent 8cc5eb5 commit 9d59946
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
46 changes: 44 additions & 2 deletions src/backend/metal/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,21 @@ impl adapter::PhysicalDevice<Backend> for PhysicalDevice {
_usage: hal::buffer::Usage,
_sparse: hal::memory::SparseFlags,
_memory_type: hal::external_memory::ExternalMemoryType,
) -> hal::external_memory::ExternalBufferProperties {
unimplemented!()
}

fn external_image_properties(
&self,
_format: hal::format::Format,
_dimensions: u8,
_tiling: hal::image::Tiling,
_usage: hal::image::Usage,
_view_caps: hal::image::ViewCapabilities,
_memory_type: hal::external_memory::ExternalMemoryType,
) -> Result<
hal::external_memory::ExternalBufferProperties,
hal::external_memory::ExternalMemoryQueryError,
hal::external_memory::ExternalMemoryProperties,
hal::external_memory::ExternalImageQueryError,
> {
unimplemented!()
}
Expand Down Expand Up @@ -3586,6 +3598,36 @@ impl hal::device::Device<Backend> for Device {
unimplemented!()
}


unsafe fn create_allocate_external_image(
&self,
_external_memory_types: hal::external_memory::ExternalMemoryTypeFlags,
_kind: image::Kind,
_num_levels: image::Level,
_format: Format,
_tiling: image::Tiling,
_usage: image::Usage,
_sparse: memory::SparseFlags,
_view_caps: image::ViewCapabilities,
_type_mask: u32,
) -> Result<(n::Image, n::Memory), hal::external_memory::ExternalImageCreateAllocateError> {
unimplemented!()
}

unsafe fn import_external_image(
&self,
_external_memory: hal::external_memory::ExternalMemory,
_kind: image::Kind,
_num_levels: image::Level,
_format: Format,
_tiling: image::Tiling,
_usage: image::Usage,
_sparse: memory::SparseFlags,
_view_caps: image::ViewCapabilities,
_type_mask: u32,
) -> Result<(n::Image, n::Memory), hal::external_memory::ExternalImageImportError> {
un

unsafe fn export_memory(
&self,
_external_memory_type: hal::external_memory::ExternalMemoryType,
Expand Down
4 changes: 2 additions & 2 deletions src/hal/src/external_memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ pub enum ExternalMemory {
#[cfg(windows)]
/// Tmp. Size is ignored
D3D12Resource(Handle),
#[cfg(any(target_os = "linux", target_os = "android", doc))]
#[cfg(any(target_os = "linux", target_os = "android"))]
/// Tmp
DmaBuf(Fd),
#[cfg(any(target_os = "android", doc))]
#[cfg(any(target_os = "android"))]
/// Tmp
AndroidHardwareBuffer(Fd),
/// Tmp
Expand Down

0 comments on commit 9d59946

Please sign in to comment.