diff --git a/CHANGELOG.md b/CHANGELOG.md index 18a9a81d2..243f35b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,10 @@ Bottom level categories: ## Unreleased +### Documentation + +- Document Wayland specific behavior related to `SurfaceTexture::present`. By @i509VCB in [#5092](https://github.com/gfx-rs/wgpu/pull/5092). + ### New features - Many numeric built-ins have had a constant evaluation implementation added for them, which allows them to be used in a `const` context: diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index a7dc98fff..9b4af33cd 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -4738,6 +4738,12 @@ impl SurfaceTexture { /// Schedule this texture to be presented on the owning surface. /// /// Needs to be called after any work on the texture is scheduled via [`Queue::submit`]. + /// + /// # Platform dependent behavior + /// + /// On Wayland, `present` will attach a `wl_buffer` to the underlying `wl_surface` and commit the new surface + /// state. If it is desired to do things such as request a frame callback, scale the surface using the viewporter + /// or synchronize other double buffered state, then these operations should be done before the call to `present`. pub fn present(mut self) { self.presented = true; DynContext::surface_present(