跳到主要内容

StagingTexture

搜索

结构体 StagingTexture 

源代码
pub struct StagingTexture { /* private fields */ }
展开描述

可复用的 CPU 读/写暂存纹理包装器。

实现§

源代码§

impl StagingTexture

源代码

pub fn new( device: &ID3D11Device, width: u32, height: u32, format: DXGI_FORMAT, ) -> Result<Self, Error>

创建一个适合以给定几何/格式进行 CPU 读/写的临时纹理。

源代码

pub const fn texture(&self) -> &ID3D11Texture2D

获取底层 [windows::Win32::Graphics::Direct3D11::ID3D11Texture2D]。

源代码

pub const fn desc(&self) -> D3D11_TEXTURE2D_DESC

获取纹理的描述。

源代码

pub const fn is_mapped(&self) -> bool

检查纹理当前是否已映射。

源代码

pub const fn set_mapped(&mut self, mapped: bool)

将纹理标记为已映射或未映射。

源代码

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 实现§

blanket 实现§

源代码§

impl<T> Any for T
where T: 'static + ?Sized,

源代码§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
源代码§

impl<T> Borrow<T> for T
where T: ?Sized,

源代码§

fn borrow(&self) -> &T

从拥有的值不可变地借用。 阅读更多
源代码§

impl<T> BorrowMut<T> for T
where T: ?Sized,

源代码§

fn borrow_mut(&mut self) -> &mut T

从拥有的值可变地借用。 阅读更多
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

impl<T, U> Into<U> for T
where U: From<T>,

源代码§

fn into(self) -> U

调用 U::from(self)

That is, this conversion is whatever the implementation of From<T> for U 的实现方式。

源代码§

impl<T> IntoEither for T

源代码§

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>
where F: FnOnce(&Self) -> bool,

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. 阅读更多
源代码§

impl<T> Pointable for T

源代码§

const ALIGN: usize

指针的对齐方式。
源代码§

type Init = T

初始化器的类型。
源代码§

unsafe fn init(init: <T as Pointable>::Init) -> usize

使用给定的初始化器初始化内存。 阅读更多
源代码§

unsafe fn deref<'a>(ptr: usize) -> &'a T

解引用给定的指针。 阅读更多
源代码§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

可变地解引用给定的指针。 阅读更多
源代码§

unsafe fn drop(ptr: usize)

释放给定指针指向的对象。 阅读更多
源代码§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

源代码§

type Error = Infallible

在转换出错时返回的类型。
源代码§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
源代码§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

源代码§

type Error = <U as TryFrom<T>>::Error

在转换出错时返回的类型。
源代码§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。