diff options
author | 2023-11-28 23:13:38 +0100 | |
---|---|---|
committer | 2023-11-28 23:13:38 +0100 | |
commit | ab7dae554cac801aeed5d9aa4d3850d50be86263 (patch) | |
tree | 4165df808d50fbaa4cb9b27ded59077b769a4135 /examples/custom_shader/src/scene.rs | |
parent | 100d15f30654d446cffe2fb60a435c79c81b0188 (diff) | |
download | iced-ab7dae554cac801aeed5d9aa4d3850d50be86263.tar.gz iced-ab7dae554cac801aeed5d9aa4d3850d50be86263.tar.bz2 iced-ab7dae554cac801aeed5d9aa4d3850d50be86263.zip |
Provide actual bounds to `Shader` primitives
... and allow for proper translation and scissoring.
Diffstat (limited to 'examples/custom_shader/src/scene.rs')
-rw-r--r-- | examples/custom_shader/src/scene.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/custom_shader/src/scene.rs b/examples/custom_shader/src/scene.rs index 3b291ce2..a35efdd9 100644 --- a/examples/custom_shader/src/scene.rs +++ b/examples/custom_shader/src/scene.rs @@ -133,9 +133,9 @@ impl shader::Primitive for Primitive { format: wgpu::TextureFormat, device: &wgpu::Device, queue: &wgpu::Queue, + _bounds: Rectangle, target_size: Size<u32>, _scale_factor: f32, - _transform: shader::Transformation, storage: &mut shader::Storage, ) { if !storage.has::<Pipeline>() { @@ -158,9 +158,9 @@ impl shader::Primitive for Primitive { fn render( &self, storage: &shader::Storage, - bounds: Rectangle<u32>, target: &wgpu::TextureView, _target_size: Size<u32>, + viewport: Rectangle<u32>, encoder: &mut wgpu::CommandEncoder, ) { //at this point our pipeline should always be initialized @@ -170,7 +170,7 @@ impl shader::Primitive for Primitive { pipeline.render( target, encoder, - bounds, + viewport, self.cubes.len() as u32, self.show_depth_buffer, ); |