#[non_exhaustive]pub enum Compression {
Any,
Scheme(CompressionScheme),
}Expand description
Requested tile-compression behavior for an image allocation (set via
ImageDesc::with_compression).
Vendor GPUs store textures in proprietary compressed tile layouts
(UBWC, AFBC, PVRIC, DCC) that cut memory bandwidth; eligibility
requires a hardware-only buffer (CpuAccess::None) because CPU
mapping pins the layout linear. The request records best knowledge on
the tensor (Tensor::compression); it never changes what bytes a
consumer sees through the GPU/NPU.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Any
Let the platform use its native scheme when the format is
eligible; otherwise allocate linear and count the fallback
(compression_fallback_count). The right default for pipelines
that want the bandwidth win without portability failures.
Scheme(CompressionScheme)
Require one specific scheme: allocation fails with
Error::InvalidArgument when the device’s scheme differs and
[Error::NotSupported] on platforms without vendor tile
compression. For consumers whose ABI names a layout (e.g. a
QNN context binary declaring UBWC inputs).
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Compression
Source§impl Debug for Compression
impl Debug for Compression
impl Eq for Compression
Source§impl PartialEq for Compression
impl PartialEq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnsafeUnpin for Compression
impl UnwindSafe for Compression
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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. Read more