wgpu: Add get_configuration to Surface (#8664)

This commit is contained in:
Sam authored and GitHub committed 2025-12-06 11:10:16 -05:00
1 parent 21e6143ed0
commit 90db08157c
2 files changed
+8

No files matched your search

+1
View File
@@ -163,6 +163,7 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).
- Implement shader triangle barycentric coordinate builtins. By @atlv24 in [#8320](https://github.com/gfx-rs/wgpu/pull/8320).
- Added support for binding arrays of storage textures on Metal. By @msvbg in [#8464](https://github.com/gfx-rs/wgpu/pull/8464)
- 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).
- 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).
### Changes
+7
View File
@@ -99,6 +99,13 @@ impl Surface<'_> {
*conf = Some(config.clone());
}
/// Returns the current configuration of [`Surface`], if configured.
///
/// This is similar to [WebGPU `GPUcCanvasContext::getConfiguration`](https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-getconfiguration).
pub fn get_configuration(&self) -> Option<SurfaceConfiguration> {
self.config.lock().clone()
}
/// Returns the next texture to be presented by the swapchain for drawing.
///
/// In order to present the [`SurfaceTexture`] returned by this method,