I would like to discuss whether imaging should support drawing through user-defined/custom pipelines, similar in spirit to custom shaders in wgpu or skia's sksL.
the design in my mind right now would be like a generalized version of bevy's SpecializedRenderPipeline:
trait PipelineDesc {
/// the data type for this pipeline
type State;
fn draw(&self, state: &State);
// ...
}
// pipeline with data, store as draw commands
struct PipeLine<P: PipelineDesc> {
desc: P,
data: P::State,
}
trait PipelineSpecializer {
type Key: Clone + Hash + PartialEq + Eq;
type Desc: PipelineDesc;
/// Construct a new render pipeline based on the provided key.
fn specialize(&self, key: Self::Key) -> Desc;
}
pub struct PipelineRef<'a> {
pub transform: Affine,
pipeline: &'a dyn Pipeline,
// ...
}
I believe we can do runtime type checking, to match the type of Pipeline and its caller, though I don't have a clear thought now.
Will custom pipeline draw command be supported, or it is not in plan? If so, I'd be happy to contribute.
I would like to discuss whether
imagingshould support drawing through user-defined/custom pipelines, similar in spirit to custom shaders in wgpu or skia's sksL.the design in my mind right now would be like a generalized version of bevy's SpecializedRenderPipeline:
I believe we can do runtime type checking, to match the type of
Pipelineand its caller, though I don't have a clear thought now.Will custom pipeline draw command be supported, or it is not in plan? If so, I'd be happy to contribute.