mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Add texture_from_raw method for metal/dx12 device
This commit is contained in:
committed by
Dzmitry Malyshau
parent
8568188558
commit
cd9498d447
@@ -280,6 +280,24 @@ impl super::Device {
|
||||
);
|
||||
result
|
||||
}
|
||||
|
||||
pub unsafe fn texture_from_raw(
|
||||
resource: native::Resource,
|
||||
format: wgt::TextureFormat,
|
||||
dimension: wgt::TextureDimension,
|
||||
size: wgt::Extent3d,
|
||||
mip_level_count: u32,
|
||||
sample_count: u32,
|
||||
) -> super::Texture {
|
||||
super::Texture {
|
||||
resource,
|
||||
format,
|
||||
dimension,
|
||||
size,
|
||||
mip_level_count,
|
||||
sample_count,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::Device<super::Api> for super::Device {
|
||||
|
||||
@@ -174,6 +174,24 @@ impl super::Device {
|
||||
.set_mutability(mtl::MTLMutability::Immutable);
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn texture_from_raw(
|
||||
raw: mtl::Texture,
|
||||
raw_format: mtl::MTLPixelFormat,
|
||||
raw_type: mtl::MTLTextureType,
|
||||
array_layers: u32,
|
||||
mip_levels: u32,
|
||||
copy_size: crate::CopyExtent,
|
||||
) -> super::Texture {
|
||||
super::Texture {
|
||||
raw,
|
||||
raw_format,
|
||||
raw_type,
|
||||
array_layers,
|
||||
mip_levels,
|
||||
copy_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::Device<super::Api> for super::Device {
|
||||
|
||||
Reference in New Issue
Block a user