diff options
Diffstat (limited to 'wgpu/src/image.rs')
-rw-r--r-- | wgpu/src/image.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index c883eaa8..c42e1cd4 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -1,4 +1,5 @@ use crate::Transformation; +use iced_native::Rectangle; use std::cell::RefCell; use std::collections::HashMap; @@ -218,6 +219,7 @@ impl Pipeline { encoder: &mut wgpu::CommandEncoder, instances: &[Image], transformation: Transformation, + bounds: Rectangle<u32>, target: &wgpu::TextureView, ) { let matrix: [f32; 16] = transformation.into(); @@ -291,6 +293,12 @@ impl Pipeline { 0, &[(&self.vertices, 0), (&self.instances, 0)], ); + render_pass.set_scissor_rect( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + ); render_pass.draw_indexed( 0..QUAD_INDICES.len() as u32, |