#[non_exhaustive]pub struct GpuDecoder;Expand description
GPU-backed decoder using vyre’s cached runtime device.
This struct is #[non_exhaustive] to allow adding new internal state
(like shader caches or command buffers) without breaking consumers.
§Examples
use vyre_wgpu::engine::decode::GpuDecoder;
// Requires a GPU device to succeed.
let _ = GpuDecoder::new();Implementations§
Source§impl GpuDecoder
impl GpuDecoder
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a decoder backed by vyre::runtime::cached_device().
§Errors
Returns an error if the GPU device cannot be initialized or if the hardware is incompatible with the decode shaders.
Sourcepub fn try_new() -> Result<Self>
pub fn try_new() -> Result<Self>
Try to initialize the shared GPU device.
§Errors
Returns Error::Gpu if the GPU device cannot be initialized.
Sourcepub fn decode_recursive(&self, file_bytes: &[u8]) -> Result<Vec<DecodedRegion>>
pub fn decode_recursive(&self, file_bytes: &[u8]) -> Result<Vec<DecodedRegion>>
Decode all supported encodings recursively.
§Errors
Returns Error::Decode if the GPU decode dispatch or recursive frontier management fails.
Returns Error::Gpu if the GPU device cannot be initialized or a buffer operation fails.
Sourcepub fn decode_recursive_with_rules(
&self,
file_bytes: &[u8],
rules: &DecodeRules,
) -> Result<Vec<DecodedRegion>>
pub fn decode_recursive_with_rules( &self, file_bytes: &[u8], rules: &DecodeRules, ) -> Result<Vec<DecodedRegion>>
Decode recursively using caller-provided rules.
§Errors
Returns Error::Decode if max_passes is zero or the GPU decode dispatch fails.
Returns Error::Gpu if the GPU device cannot be initialized or a buffer operation fails.
Trait Implementations§
Source§impl Clone for GpuDecoder
impl Clone for GpuDecoder
Source§fn clone(&self) -> GpuDecoder
fn clone(&self) -> GpuDecoder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more