mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
Added from_custom to texture (#8315)
This commit is contained in:
1 parent
3958790a85
commit
d0bb62a157
2 files changed
+21
No files matched your search
@@ -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.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user