mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Added from_custom to texture (#8315)
This commit is contained in:
parent
3958790a85
commit
d0bb62a157
@ -72,6 +72,11 @@ SamplerDescriptor {
|
||||
...
|
||||
}
|
||||
```
|
||||
### Changes
|
||||
|
||||
#### General
|
||||
|
||||
- Texture now has `from_custom`. By @R-Cramer4 in [#8315](https://github.com/gfx-rs/wgpu/pull/8315).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
@ -69,6 +69,22 @@ impl Texture {
|
||||
self.inner.as_custom()
|
||||
}
|
||||
|
||||
#[cfg(custom)]
|
||||
/// Creates a texture from already created custom implementation with the given description
|
||||
pub fn from_custom<T: custom::TextureInterface>(
|
||||
texture: T,
|
||||
desc: &TextureDescriptor<'_>,
|
||||
) -> Self {
|
||||
Self {
|
||||
inner: dispatch::DispatchTexture::custom(texture),
|
||||
descriptor: TextureDescriptor {
|
||||
label: None,
|
||||
view_formats: &[],
|
||||
..desc.clone()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a view of this texture, specifying an interpretation of its texels and
|
||||
/// possibly a subset of its layers and mip levels.
|
||||
///
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user