pub struct TileRenderPipeline {
pub compositor: TileCompositor,
pub color_matrix: ColorMatrix,
pub shader_registry: HotReloadRegistry,
}Expand description
High-level CPU rendering pipeline: shader hot-reload + layer compositing
- optional colour-matrix post-processing.
Fields§
§compositor: TileCompositor§color_matrix: ColorMatrixDefault colour matrix applied by Self::render (identity by default).
shader_registry: HotReloadRegistryImplementations§
Source§impl TileRenderPipeline
impl TileRenderPipeline
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Create a new pipeline for a tile of the given size.
Sourcepub fn add_shader(&mut self, label: impl Into<String>, wgsl: impl Into<String>)
pub fn add_shader(&mut self, label: impl Into<String>, wgsl: impl Into<String>)
Register a WGSL shader source with the hot-reload registry.
Sourcepub fn update_shader(
&mut self,
label: &str,
new_wgsl: impl Into<String>,
) -> bool
pub fn update_shader( &mut self, label: &str, new_wgsl: impl Into<String>, ) -> bool
Update a registered shader source, bumping its version.
Returns true if the label existed; false otherwise.
Sourcepub fn render(&self, layers: &mut [Layer]) -> Vec<u8> ⓘ
pub fn render(&self, layers: &mut [Layer]) -> Vec<u8> ⓘ
Composite layers, apply the pipeline’s default colour matrix, and
return the result as interleaved RGBA bytes.
Sourcepub fn render_with_matrix(
&self,
layers: &mut [Layer],
matrix: &ColorMatrix,
) -> Vec<u8> ⓘ
pub fn render_with_matrix( &self, layers: &mut [Layer], matrix: &ColorMatrix, ) -> Vec<u8> ⓘ
Composite layers, apply matrix, and return RGBA bytes.
Auto Trait Implementations§
impl Freeze for TileRenderPipeline
impl RefUnwindSafe for TileRenderPipeline
impl Send for TileRenderPipeline
impl Sync for TileRenderPipeline
impl Unpin for TileRenderPipeline
impl UnsafeUnpin for TileRenderPipeline
impl UnwindSafe for TileRenderPipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more