diff --git a/CHANGELOG.md b/CHANGELOG.md index d80f33e2b1..c386474e96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,13 +100,15 @@ the same every time it is rendered, we now warn if it is missing. - Add WGSL examples to complement existing examples written in GLSL by @norepimorphism in [#2888](https://github.com/gfx-rs/wgpu/pull/2888) - Document `wgpu_core` resource allocation. @jimb in [#2973](https://github.com/gfx-rs/wgpu/pull/2973) -### Performance +- Expanded `StagingBelt` documentation by @kpreid in [#2905](https://github.com/gfx-rs/wgpu/pull/2905) -- Made `StagingBelt::write_buffer()` check more thoroughly for reusable memory; by @kpreid in [#2906](https://github.com/gfx-rs/wgpu/pull/2906) +- Fixed documentation for `Instance::create_surface_from_canvas` and + `Instance::create_surface_from_offscreen_canvas` regarding their + safety contract. These functions are not unsafe. [#2990](https://github.com/gfx-rs/wgpu/pull/2990) -### Documentation +### Performance -- Expanded `StagingBelt` documentation by @kpreid in [#2905](https://github.com/gfx-rs/wgpu/pull/2905) +- Made `StagingBelt::write_buffer()` check more thoroughly for reusable memory; by @kpreid in [#2906](https://github.com/gfx-rs/wgpu/pull/2906) ### Build Configuration diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index ad94bd5b1c..3285f33022 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -1792,9 +1792,8 @@ impl Instance { /// Creates a surface from a `web_sys::HtmlCanvasElement`. /// - /// # Safety - /// - /// - canvas must be a valid element to create a surface upon. + /// The `canvas` argument must be a valid `` element to + /// create a surface upon. #[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))] pub fn create_surface_from_canvas(&self, canvas: &web_sys::HtmlCanvasElement) -> Surface { Surface { @@ -1805,9 +1804,8 @@ impl Instance { /// Creates a surface from a `web_sys::OffscreenCanvas`. /// - /// # Safety - /// - /// - canvas must be a valid OffscreenCanvas to create a surface upon. + /// The `canvas` argument must be a valid `OffscreenCanvas` object + /// to create a surface upon. #[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))] pub fn create_surface_from_offscreen_canvas( &self,