pub struct TextureDesc {Show 13 fields
pub address_u: AddressMode,
pub address_v: AddressMode,
pub address_w: AddressMode,
pub filter_mode: FilterMode,
pub normalized_coords: bool,
pub read_as_integer: bool,
pub srgb: bool,
pub max_anisotropy: u32,
pub mipmap_filter: FilterMode,
pub mipmap_bias: f32,
pub min_lod: f32,
pub max_lod: f32,
pub border_color: [f32; 4],
}Expand description
Ergonomic texture-object sampling configuration.
Converted to CUDA_TEXTURE_DESC when creating a CudaTextureObject.
Fields§
§address_u: AddressModeAddress mode for the U (X) dimension.
address_v: AddressModeAddress mode for the V (Y) dimension.
address_w: AddressModeAddress mode for the W (Z) dimension.
filter_mode: FilterModeSampling filter mode.
normalized_coords: boolWhen true, texture coordinates are in the normalized range [0, 1).
read_as_integer: boolWhen true, texture reads return raw integers rather than normalized floats.
srgb: boolWhen true, hardware applies sRGB gamma decoding on read.
max_anisotropy: u32Maximum anisotropy ratio (1–16; 1 disables anisotropy).
mipmap_filter: FilterModeMipmap filter mode.
mipmap_bias: f32Mipmap LOD bias.
min_lod: f32Minimum mipmap LOD clamp.
max_lod: f32Maximum mipmap LOD clamp.
border_color: [f32; 4]Border color (RGBA).
Implementations§
Source§impl TextureDesc
impl TextureDesc
Sourcepub const fn default_2d() -> Self
pub const fn default_2d() -> Self
Construct a sensible default texture descriptor:
- Clamp address mode on all axes
- Nearest-neighbor filtering (no mipmap)
- Normalized coordinates
- No anisotropy
Sourcepub fn as_raw(&self) -> CUDA_TEXTURE_DESC
pub fn as_raw(&self) -> CUDA_TEXTURE_DESC
Convert to the raw CUDA_TEXTURE_DESC expected by the driver.
Trait Implementations§
Source§impl Clone for TextureDesc
impl Clone for TextureDesc
Source§fn clone(&self) -> TextureDesc
fn clone(&self) -> TextureDesc
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextureDesc
Auto Trait Implementations§
impl Freeze for TextureDesc
impl RefUnwindSafe for TextureDesc
impl Send for TextureDesc
impl Sync for TextureDesc
impl Unpin for TextureDesc
impl UnsafeUnpin for TextureDesc
impl UnwindSafe for TextureDesc
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