pub struct StagingTexture { /* private fields */ }展开描述
可复用的 CPU 读/写暂存纹理包装器。
实现§
源代码§impl StagingTexture
impl StagingTexture
源代码pub 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>
创建一个适合以给定几何/格式进行 CPU 读/写的临时纹理。
源代码pub const fn texture(&self) -> &ID3D11Texture2D
pub const fn texture(&self) -> &ID3D11Texture2D
获取底层 [windows::Win32::Graphics::Direct3D11::ID3D11Texture2D]。
源代码pub const fn set_mapped(&mut self, mapped: bool)
pub const fn set_mapped(&mut self, mapped: bool)
将纹理标记为已映射或未映射。
源代码pub fn from_raw_checked(tex: ID3D11Texture2D) -> Option<Self>
pub fn from_raw_checked(tex: ID3D11Texture2D) -> Option<Self>
将外部构造的纹理验证为 CPU 临时纹理。
The texture must have been created with D3D11_USAGE_STAGING usage and
D3D11_CPU_ACCESS_READ and D3D11_CPU_ACCESS_WRITE CPU access flags.
自动 trait 实现§
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 实现§
源代码§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
源代码§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
从拥有的值可变地借用。 阅读更多
源代码§impl<T> IntoEither for T
impl<T> IntoEither for T
源代码§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. 阅读更多源代码§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. 阅读更多