pub trait ComputeBackend: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn gpu_info(&self) -> &GpuInfo;
fn decompress_tiles(
&self,
tiles: &[CompressedTile],
cancel: &AtomicBool,
) -> Result<Vec<Vec<u8>>>;
fn decompress_tiles_gdeflate(
&self,
tiles: &[CompressedTile],
cancel: &AtomicBool,
) -> Result<Vec<Vec<u8>>>;
fn release(&self);
}Expand description
Abstraction over GPU compute backends (wgpu, CUDA).
All methods that can fail return crush_core::error::Result so the
engine can decide whether to fall back to CPU.
Required Methods§
Sourcefn decompress_tiles(
&self,
tiles: &[CompressedTile],
cancel: &AtomicBool,
) -> Result<Vec<Vec<u8>>>
fn decompress_tiles( &self, tiles: &[CompressedTile], cancel: &AtomicBool, ) -> Result<Vec<Vec<u8>>>
Sourcefn decompress_tiles_gdeflate(
&self,
tiles: &[CompressedTile],
cancel: &AtomicBool,
) -> Result<Vec<Vec<u8>>>
fn decompress_tiles_gdeflate( &self, tiles: &[CompressedTile], cancel: &AtomicBool, ) -> Result<Vec<Vec<u8>>>
Decompress a batch of GDeflate-encoded tiles on the GPU.
Returns one Vec<u8> per input tile in the same order.
The output is already in the correct byte order (no de-interleaving).
§Cancellation
Implementations should check cancel between tile dispatches
and return CrushError::Cancelled when set.
§Errors
May return any GPU error variant wrapped in a CrushError.