Added from_custom to texture (#8315)

This commit is contained in:
Robin Cramer authored and GitHub committed 2025-10-09 17:22:54 +02:00
1 parent 3958790a85
commit d0bb62a157
2 files changed
+21

No files matched your search

+5
View File
@@ -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
+16
View File
@@ -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.
///