pub trait CubeTask<C: Compiler>:
KernelMetadata
+ Send
+ Sync {
// Required methods
fn define(&self) -> KernelDefinition;
fn compile(
&self,
definition: KernelDefinition,
compiler: &mut C,
compilation_options: &C::CompilationOptions,
mode: ExecutionMode,
address_type: StorageType,
) -> Result<CompiledKernel<C>, CompilationError>;
}Expand description
Kernel trait with the ComputeShader that will be compiled and cached based on the
provided id.
Required Methods§
Sourcefn define(&self) -> KernelDefinition
fn define(&self) -> KernelDefinition
Expand the kernel into its definition.
Kept separate from CubeTask::compile so a server can hash the definition to key the
compilation cache, then hand the same definition back on a miss instead of expanding twice.
Sourcefn compile(
&self,
definition: KernelDefinition,
compiler: &mut C,
compilation_options: &C::CompilationOptions,
mode: ExecutionMode,
address_type: StorageType,
) -> Result<CompiledKernel<C>, CompilationError>
fn compile( &self, definition: KernelDefinition, compiler: &mut C, compilation_options: &C::CompilationOptions, mode: ExecutionMode, address_type: StorageType, ) -> Result<CompiledKernel<C>, CompilationError>
Compile a kernel definition and return the compiled form with an optional non-text representation.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".