pub struct StagingTexture { /* private fields */ }Expand description
Reusable CPU-read/write staging texture wrapper.
Implementationsยง
Sourceยงimpl StagingTexture
impl StagingTexture
Sourcepub fn new(
device: &ID3D11Device,
width: u32,
height: u32,
format: DXGI_FORMAT,
) -> Result<Self, Error>
pub fn new( device: &ID3D11Device, width: u32, height: u32, format: DXGI_FORMAT, ) -> Result<Self, Error>
Create a staging texture suitable for CPU read/write with the given geometry/format.
Sourcepub const fn texture(&self) -> &ID3D11Texture2D
pub const fn texture(&self) -> &ID3D11Texture2D
Gets the underlying [windows::Win32::Graphics::Direct3D11::ID3D11Texture2D].
Sourcepub const fn set_mapped(&mut self, mapped: bool)
pub const fn set_mapped(&mut self, mapped: bool)
Marks the texture as mapped or unmapped.
Sourcepub fn from_raw_checked(tex: ID3D11Texture2D) -> Option<Self>
pub fn from_raw_checked(tex: ID3D11Texture2D) -> Option<Self>
Validate an externally constructed texture as a CPU staging texture.
The texture must have been created with D3D11_USAGE_STAGING usage and
D3D11_CPU_ACCESS_READ and D3D11_CPU_ACCESS_WRITE CPU access flags.
Auto Trait Implementationsยง
impl Freeze for StagingTexture
impl RefUnwindSafe for StagingTexture
impl Send for StagingTexture
impl Sync for StagingTexture
impl Unpin for StagingTexture
impl UnsafeUnpin for StagingTexture
impl UnwindSafe for StagingTexture
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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