summaryrefslogtreecommitdiffstats
path: root/wgpu/src/primitive
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-28 23:13:38 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-28 23:13:38 +0100
commitab7dae554cac801aeed5d9aa4d3850d50be86263 (patch)
tree4165df808d50fbaa4cb9b27ded59077b769a4135 /wgpu/src/primitive
parent100d15f30654d446cffe2fb60a435c79c81b0188 (diff)
downloadiced-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 'wgpu/src/primitive')
-rw-r--r--wgpu/src/primitive/pipeline.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/wgpu/src/primitive/pipeline.rs b/wgpu/src/primitive/pipeline.rs
index 5dbd6697..302e38f6 100644
--- a/wgpu/src/primitive/pipeline.rs
+++ b/wgpu/src/primitive/pipeline.rs
@@ -1,6 +1,5 @@
//! Draw primitives using custom pipelines.
use crate::core::{Rectangle, Size};
-use crate::graphics::Transformation;
use std::any::{Any, TypeId};
use std::collections::HashMap;
@@ -41,9 +40,9 @@ pub trait Primitive: Debug + Send + Sync + 'static {
format: wgpu::TextureFormat,
device: &wgpu::Device,
queue: &wgpu::Queue,
+ bounds: Rectangle,
target_size: Size<u32>,
scale_factor: f32,
- transform: Transformation,
storage: &mut Storage,
);
@@ -51,9 +50,9 @@ pub trait Primitive: Debug + Send + Sync + 'static {
fn render(
&self,
storage: &Storage,
- bounds: Rectangle<u32>,
target: &wgpu::TextureView,
target_size: Size<u32>,
+ viewport: Rectangle<u32>,
encoder: &mut wgpu::CommandEncoder,
);
}