Skip to main content

WorkerLane

Trait WorkerLane 

Source
pub trait WorkerLane: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn render_chunk(
        &self,
        scene: &SceneState,
        range: SampleRange,
        cancel: &CancelToken,
    ) -> ChunkResult;
}
Expand description

One backend contributing samples to an image: a joined remote worker, a TLS connection to a plain worker, or the local CPU/GPU. The crate::LanePool does not care which.

Implementations are shared across the pool’s lane threads, hence Send + Sync; one lane is only ever asked for one chunk at a time by the pool.

Required Methods§

Source

fn name(&self) -> &str

A short human-readable name for notes (“worker gpu-01”, “local CPU”).

Source

fn render_chunk( &self, scene: &SceneState, range: SampleRange, cancel: &CancelToken, ) -> ChunkResult

Traces range of scene at scene.width x scene.height and returns the summed radiance of the traced prefix.

Must return promptly (with whatever prefix is done) once cancel is raised. Must never trace or report samples outside range: a result whose done exceeds range.samples, or whose sum has the wrong length, is discarded and counted as a failed chunk.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§