pub struct SurfaceTexture {
pub texture: Texture,
pub suboptimal: bool,
/* private fields */
}Expand description
Surface texture that can be rendered to.
Result of a successful call to Surface::get_current_texture.
This type is unique to the Rust API of wgpu. In the WebGPU specification,
the GPUCanvasContext provides
a texture without any additional information.
Fields§
§texture: TextureAccessible view of the frame.
suboptimal: booltrue if the acquired buffer can still be used for rendering,
but should be recreated for maximum performance.
Implementations§
Source§impl SurfaceTexture
impl SurfaceTexture
Sourcepub fn present(self)
pub fn present(self)
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.
Trait Implementations§
Source§impl Debug for SurfaceTexture
impl Debug for SurfaceTexture
Auto Trait Implementations§
impl Freeze for SurfaceTexture
impl !RefUnwindSafe for SurfaceTexture
impl Send for SurfaceTexture
impl Sync for SurfaceTexture
impl Unpin for SurfaceTexture
impl !UnwindSafe for SurfaceTexture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more