pub struct TextureObject { /* private fields */ }Expand description
A texture object — a read-only sampler bound to an array (or linear
device memory). Pass as_raw() as a u64 kernel argument.
Implementations§
Source§impl TextureObject
impl TextureObject
Sourcepub fn new(
array: &Array,
tex_desc: &cudaTextureDesc,
view_desc: Option<&cudaResourceViewDesc>,
) -> Result<Self>
pub fn new( array: &Array, tex_desc: &cudaTextureDesc, view_desc: Option<&cudaResourceViewDesc>, ) -> Result<Self>
Create a texture object over an array with the given sampler + view.
Sourcepub unsafe fn from_resource(
res_desc: &cudaResourceDesc,
tex_desc: &cudaTextureDesc,
view_desc: Option<&cudaResourceViewDesc>,
) -> Result<Self>
pub unsafe fn from_resource( res_desc: &cudaResourceDesc, tex_desc: &cudaTextureDesc, view_desc: Option<&cudaResourceViewDesc>, ) -> Result<Self>
Create a texture over a raw cudaResourceDesc (e.g. a linear
memory slab).
§Safety
res_desc’s backing memory must outlive the returned texture.
pub fn as_raw(&self) -> cudaTextureObject_t
Sourcepub fn resource_desc(&self) -> Result<cudaResourceDesc>
pub fn resource_desc(&self) -> Result<cudaResourceDesc>
Query the resource descriptor the texture was created with.
Sourcepub fn texture_desc(&self) -> Result<cudaTextureDesc>
pub fn texture_desc(&self) -> Result<cudaTextureDesc>
Query the sampler (filter/address/normalize) state.
Trait Implementations§
Source§impl Debug for TextureObject
impl Debug for TextureObject
Source§impl Drop for TextureObject
impl Drop for TextureObject
Auto Trait Implementations§
impl Freeze for TextureObject
impl RefUnwindSafe for TextureObject
impl Send for TextureObject
impl Sync for TextureObject
impl Unpin for TextureObject
impl UnsafeUnpin for TextureObject
impl UnwindSafe for TextureObject
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