use std::sync::atomic::AtomicBool;
use glam::Vec3;
use super::{GpuAccumulate, GpuBatchItem, GpuPipelineKind, GpuSceneRef};
pub struct GpuBackend;
impl GpuBackend {
#[must_use]
pub const fn acquire() -> Self {
Self
}
#[must_use]
pub const fn disabled() -> Self {
Self
}
#[must_use]
pub const fn adapter_label(&self) -> Option<String> {
None
}
pub const fn set_pipeline_kind(&self, _kind: GpuPipelineKind) {}
#[must_use]
pub const fn is_lost(&self) -> bool {
false
}
#[must_use]
pub const fn try_recover(&self) -> bool {
true
}
#[must_use]
pub const fn last_lost_reason(&self) -> Option<String> {
None
}
#[allow(
clippy::unused_self,
reason = "signature must match the `gpu`-gated GpuBackend::try_accumulate"
)]
pub const fn try_accumulate(
&self,
_scene: &GpuSceneRef<'_>,
_sample_offset: u32,
_spp: u32,
_accum: &mut [Vec3],
) -> bool {
false
}
pub const fn try_accumulate_cancellable(
&self,
_scene: &GpuSceneRef<'_>,
_sample_offset: u32,
_spp: u32,
_accum: &mut [Vec3],
_cancel: &AtomicBool,
) -> GpuAccumulate {
GpuAccumulate::Declined
}
#[allow(
clippy::unused_self,
reason = "signature must match the `gpu`-gated GpuBackend::try_accumulate_batch_cancellable"
)]
pub fn try_accumulate_batch_cancellable(
&self,
items: &mut [GpuBatchItem<'_>],
_cancel: &AtomicBool,
on_done: &mut dyn FnMut(usize, GpuAccumulate),
) {
for index in 0..items.len() {
on_done(index, GpuAccumulate::Declined);
}
}
}