diff options
author | 2022-11-03 05:06:09 +0100 | |
---|---|---|
committer | 2022-11-03 05:06:09 +0100 | |
commit | 93e309f491a8941bafb919e75d660e65071475f4 (patch) | |
tree | 642954d963667d001c3a9fbf4fb7a6b216a58f1e /wgpu/src/triangle/gradient.rs | |
parent | 99cf98971dae22ae65adb2104c5a3eec578649f1 (diff) | |
download | iced-93e309f491a8941bafb919e75d660e65071475f4.tar.gz iced-93e309f491a8941bafb919e75d660e65071475f4.tar.bz2 iced-93e309f491a8941bafb919e75d660e65071475f4.zip |
Reuse last set pipeline for `triangle` in `iced_wgpu`
Diffstat (limited to 'wgpu/src/triangle/gradient.rs')
-rw-r--r-- | wgpu/src/triangle/gradient.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/wgpu/src/triangle/gradient.rs b/wgpu/src/triangle/gradient.rs index 03332234..b06cbac6 100644 --- a/wgpu/src/triangle/gradient.rs +++ b/wgpu/src/triangle/gradient.rs @@ -245,6 +245,13 @@ impl Pipeline { self.color_stops_pending_write.color_stops.clear(); } + pub fn set_render_pass_pipeline<'a>( + &'a self, + render_pass: &mut wgpu::RenderPass<'a>, + ) { + render_pass.set_pipeline(&self.pipeline); + } + /// Configures the current render pass to draw the gradient at its offset stored in the /// [DynamicBuffer] at [index]. pub fn configure_render_pass<'a>( @@ -252,7 +259,6 @@ impl Pipeline { render_pass: &mut wgpu::RenderPass<'a>, count: usize, ) { - render_pass.set_pipeline(&self.pipeline); render_pass.set_bind_group( 0, &self.bind_group, |