diff options
author | 2023-11-14 20:59:49 +0100 | |
---|---|---|
committer | 2023-11-14 20:59:49 +0100 | |
commit | b474a2b7a763dcde6a377cb409001a7b5285ee8d (patch) | |
tree | 6e751607bb103e7011807a45797923d86214d88d /wgpu/src/layer.rs | |
parent | 817f72868746461891ca4e74473c555f3b5c5703 (diff) | |
parent | 0968c5b64a528ff92a5a93f6586eef557546da25 (diff) | |
download | iced-b474a2b7a763dcde6a377cb409001a7b5285ee8d.tar.gz iced-b474a2b7a763dcde6a377cb409001a7b5285ee8d.tar.bz2 iced-b474a2b7a763dcde6a377cb409001a7b5285ee8d.zip |
Merge pull request #2085 from bungoboingo/shader-widget
[Feature] Custom Shader Widget
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r-- | wgpu/src/layer.rs | 21 |
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(), + }); + } + } }, } } |