pub struct GraphicsResource { /* private fields */ }Expand description
Runtime-side handle to a graphics-API resource. Drop unregisters it.
Implementations§
Source§impl GraphicsResource
impl GraphicsResource
Sourcepub unsafe fn from_raw(handle: CUgraphicsResource) -> Self
pub unsafe fn from_raw(handle: CUgraphicsResource) -> Self
Wrap an already-registered resource.
§Safety
handle must be a live resource from a cuda*Register* call.
baracuda unregisters it when the last clone drops.
pub fn as_raw(&self) -> CUgraphicsResource
Sourcepub fn set_map_flags(&self, flags: u32) -> Result<()>
pub fn set_map_flags(&self, flags: u32) -> Result<()>
cudaGraphicsResourceSetMapFlags.
Sourcepub fn map(&self, stream: &Stream) -> Result<()>
pub fn map(&self, stream: &Stream) -> Result<()>
Map the resource onto stream. Pair with Self::unmap.
Sourcepub fn mapped_pointer(&self) -> Result<(*mut c_void, usize)>
pub fn mapped_pointer(&self) -> Result<(*mut c_void, usize)>
Fetch the mapped device pointer + size (buffer-type resources).
Sourcepub fn mapped_array(
&self,
array_index: u32,
mip_level: u32,
) -> Result<*mut c_void>
pub fn mapped_array( &self, array_index: u32, mip_level: u32, ) -> Result<*mut c_void>
Fetch a subresource array (image-type resources).
Sourcepub fn mapped_mipmapped_array(&self) -> Result<*mut c_void>
pub fn mapped_mipmapped_array(&self) -> Result<*mut c_void>
Fetch the mipmapped-array handle for a mapped mipmapped texture.
Trait Implementations§
Source§impl Clone for GraphicsResource
impl Clone for GraphicsResource
Source§fn clone(&self) -> GraphicsResource
fn clone(&self) -> GraphicsResource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GraphicsResource
impl RefUnwindSafe for GraphicsResource
impl Send for GraphicsResource
impl Sync for GraphicsResource
impl Unpin for GraphicsResource
impl UnsafeUnpin for GraphicsResource
impl UnwindSafe for GraphicsResource
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