summaryrefslogtreecommitdiffstats
path: root/wgpu/src/quad
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-06-27 22:10:17 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-27 22:10:17 +0200
commitc7332c15227b5b079fba4c553c321a2528abd121 (patch)
tree42360ebdd24684fb42d9185b7f888b72d418a1e0 /wgpu/src/quad
parentf6966268bb6d58b4b03ba61fc5732e1bf016e2a1 (diff)
parent677f564f087b009842207e6df74aed343454ea17 (diff)
downloadiced-c7332c15227b5b079fba4c553c321a2528abd121.tar.gz
iced-c7332c15227b5b079fba4c553c321a2528abd121.tar.bz2
iced-c7332c15227b5b079fba4c553c321a2528abd121.zip
Merge pull request #1885 from bungoboingo/gradient-packing-optimization
Small gradient optimization
Diffstat (limited to 'wgpu/src/quad')
-rw-r--r--wgpu/src/quad/gradient.rs40
1 files changed, 15 insertions, 25 deletions
diff --git a/wgpu/src/quad/gradient.rs b/wgpu/src/quad/gradient.rs
index 2b56d594..6db37252 100644
--- a/wgpu/src/quad/gradient.rs
+++ b/wgpu/src/quad/gradient.rs
@@ -96,36 +96,26 @@ impl Pipeline {
as u64,
step_mode: wgpu::VertexStepMode::Instance,
attributes: &wgpu::vertex_attr_array!(
- // Color 1
- 1 => Float32x4,
- // Color 2
- 2 => Float32x4,
- // Color 3
- 3 => Float32x4,
- // Color 4
- 4 => Float32x4,
- // Color 5
- 5 => Float32x4,
- // Color 6
- 6 => Float32x4,
- // Color 7
- 7 => Float32x4,
- // Color 8
- 8 => Float32x4,
- // Offsets 1-4
- 9 => Float32x4,
- // Offsets 5-8
- 10 => Float32x4,
+ // Colors 1-2
+ 1 => Uint32x4,
+ // Colors 3-4
+ 2 => Uint32x4,
+ // Colors 5-6
+ 3 => Uint32x4,
+ // Colors 7-8
+ 4 => Uint32x4,
+ // Offsets 1-8
+ 5 => Uint32x4,
// Direction
- 11 => Float32x4,
+ 6 => Float32x4,
// Position & Scale
- 12 => Float32x4,
+ 7 => Float32x4,
// Border color
- 13 => Float32x4,
+ 8 => Float32x4,
// Border radius
- 14 => Float32x4,
+ 9 => Float32x4,
// Border width
- 15 => Float32
+ 10 => Float32
),
},
],