tessera_ui/renderer/compute/command.rs
1//! Compute command trait and related types.
2//!
3//! This module defines the `ComputeCommand` trait that marks structs as compute
4//! operations that can be processed by the GPU compute pipeline system.
5
6use downcast_rs::{Downcast, impl_downcast};
7use dyn_clone::DynClone;
8
9use crate::SampleRegion;
10
11/// Trait for GPU compute operations that can be dispatched through the unified
12/// command system.
13pub trait ComputeCommand: DynClone + Downcast + Send + Sync {
14 /// Declares the dependency on previously rendered content for barrier
15 /// planning.
16 fn barrier(&self) -> SampleRegion;
17}
18
19impl_downcast!(ComputeCommand);
20
21dyn_clone::clone_trait_object!(ComputeCommand);