Skip to content

Commit 90db081

Browse files
authored
wgpu: Add get_configuration to Surface (#8664)
1 parent 21e6143 commit 90db081

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
163163
- Implement shader triangle barycentric coordinate builtins. By @atlv24 in [#8320](https://github.com/gfx-rs/wgpu/pull/8320).
164164
- Added support for binding arrays of storage textures on Metal. By @msvbg in [#8464](https://github.com/gfx-rs/wgpu/pull/8464)
165165
- Added support for multisampled texture arrays on Vulkan through adapter feature `MULTISAMPLE_ARRAY`. By @LaylBongers in [#8571](https://github.com/gfx-rs/wgpu/pull/8571).
166+
- Added `get_configuration` to `wgpu::Surface`, that returns the current configuration of `wgpu::Surface`. By @sagudev in [#8664](https://github.com/gfx-rs/wgpu/pull/8664).
166167

167168
### Changes
168169

wgpu/src/api/surface.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ impl Surface<'_> {
9999
*conf = Some(config.clone());
100100
}
101101

102+
/// Returns the current configuration of [`Surface`], if configured.
103+
///
104+
/// This is similar to [WebGPU `GPUcCanvasContext::getConfiguration`](https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-getconfiguration).
105+
pub fn get_configuration(&self) -> Option<SurfaceConfiguration> {
106+
self.config.lock().clone()
107+
}
108+
102109
/// Returns the next texture to be presented by the swapchain for drawing.
103110
///
104111
/// In order to present the [`SurfaceTexture`] returned by this method,

0 commit comments

Comments
 (0)