summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r--wgpu/src/layer.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 286801e6..33aaf670 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -34,6 +34,9 @@ pub struct Layer<'a> {
/// The images of the [`Layer`].
pub images: Vec<Image>,
+
+ /// The custom pipelines of this [`Layer`].
+ pub pipelines: Vec<primitive::Pipeline>,
}
impl<'a> Layer<'a> {
@@ -45,6 +48,7 @@ impl<'a> Layer<'a> {
meshes: Vec::new(),
text: Vec::new(),
images: Vec::new(),
+ pipelines: Vec::new(),
}
}
@@ -308,6 +312,23 @@ impl<'a> Layer<'a> {
}
}
},
+ primitive::Custom::Pipeline(pipeline) => {
+ let layer = &mut layers[current_layer];
+
+ let bounds = Rectangle::new(
+ Point::new(translation.x, translation.y),
+ pipeline.bounds.size(),
+ );
+
+ if let Some(clip_bounds) =
+ layer.bounds.intersection(&bounds)
+ {
+ layer.pipelines.push(primitive::Pipeline {
+ bounds: clip_bounds,
+ primitive: pipeline.primitive.clone(),
+ });
+ }
+ }
},
}
}