Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Bottom level categories:

#### 'wgpu::Instance::enumerate_adapters` is now `async` & available on WebGPU

Making `enumerate_adapters` async allows custom backends to use it along with elimnating some native/non-native distinctions
Making `enumerate_adapters` async allows custom backends to use it along with eliminating some native/non-native distinctions

This is a breaking change

Expand All @@ -54,6 +54,17 @@ This is a breaking change

By @R-Cramer4 in [#8230](https://github.com/gfx-rs/wgpu/pull/8230)

### New Features

#### Texture now has `from_custom`

- Allows the creation of a wgpu texture from a custom texture and a `TextureDescriptor`
- The texture is unable to have a label or view formats

```diff
+ pub fn from_custom<T: custom::TextureInterface>(texture: T, desc: &TextureDescriptor<'_>) -> Self {
```

## v27.0.2 (2025-10-03)

### Bug Fixes
Expand Down
16 changes: 16 additions & 0 deletions wgpu/src/api/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down