Expand description
Screenshot integration for the wgpu graphics API.
This crate re-exports the wgpu crate (ensuring version consistency
across the workspace) and provides [capture_texture], a synchronous
utility for reading a GPU texture back to CPU memory and converting it
into a Screenshot.
§Re-export
use miniscreenshot_wgpu::wgpu;§Feature selection
Enable exactly one compatibility feature to select the wgpu major
version:
wgpu-28wgpu-29
§How it works
- A staging
Bufferis created withCOPY_DST | MAP_READusage. - A
copy_texture_to_buffercommand is encoded and submitted. - The device is polled to completion (blocking).
- The staging buffer is mapped, row padding is stripped, and the pixel data is converted to RGBA8 if necessary.
Re-exports§
pub use wgpu_28 as wgpu;
Structs§
- Capture
Error - A canonical error type shared by all
Captureimplementations. - Screenshot
- A captured screenshot backed by raw RGBA8 pixel data.
- Wgpu
Capture - Borrowed view over a wgpu
Texturethat implementsCapture.
Enums§
- Wgpu
Capture Error - Errors that can occur while capturing a GPU texture.
Traits§
- Capture
- A self-contained screenshot source (e.g. a system capture session).