pub struct D3D12BufferHandle { /* private fields */ }Expand description
Buffer-dimension ID3D12Resource* (committed with
Dimension = D3D12_RESOURCE_DIMENSION_BUFFER).
Implementations§
Source§impl D3D12BufferHandle
impl D3D12BufferHandle
Sourcepub unsafe fn try_from_raw(
resource: *mut c_void,
luid: Option<(i32, u32)>,
size: u64,
keep_alive: Option<KeepAlive>,
) -> Result<Self, InvalidHandleError>
pub unsafe fn try_from_raw( resource: *mut c_void, luid: Option<(i32, u32)>, size: u64, keep_alive: Option<KeepAlive>, ) -> Result<Self, InvalidHandleError>
Wrap a raw buffer-dimension ID3D12Resource*. Borrowing: the
handle is stored non-owningly, this type has no Drop, and every
obligation below extends to each Clone.
§Safety
resourcemust point to a liveID3D12Resourcecommitted withD3D12_RESOURCE_DIMENSION_BUFFER. Handing a texture-dimension resource here type-confuses every consumer, which addresses it linearly.sizemust not exceed the resource’s actualWidthin bytes — consumers copysizebytes out of it. Zero is rejected asInvalidHandleError::ZeroSize, null asInvalidHandleError::NullPointer; neither is a caller obligation.- Refcount, lifetime, cross-thread and
luidobligations are exactly those ofD3D12Resource::try_from_raw: noAddRef, noDrop, the caller’s reference must outlive everyClone.
pub fn resource(&self) -> *mut c_void
pub fn luid(&self) -> Option<(i32, u32)>
pub fn size(&self) -> u64
pub fn keep_alive(&self) -> Option<&KeepAlive>
Trait Implementations§
Source§impl Clone for D3D12BufferHandle
impl Clone for D3D12BufferHandle
Source§impl Debug for D3D12BufferHandle
impl Debug for D3D12BufferHandle
impl Send for D3D12BufferHandle
impl Sync for D3D12BufferHandle
Auto Trait Implementations§
impl !RefUnwindSafe for D3D12BufferHandle
impl !UnwindSafe for D3D12BufferHandle
impl Freeze for D3D12BufferHandle
impl Unpin for D3D12BufferHandle
impl UnsafeUnpin for D3D12BufferHandle
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