summaryrefslogtreecommitdiffstats
path: root/wgpu/src/triangle.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-05-29 16:44:56 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-06-06 16:46:20 -0700
commitea7f2626b11af249510b27001fb6addd7f9210a9 (patch)
treeb9a685c94c9cd536f74bdf4e20b25de8ac6b5bd8 /wgpu/src/triangle.rs
parentc15f1b5f6575792cc89bb5fba2e613428397e46a (diff)
downloadiced-ea7f2626b11af249510b27001fb6addd7f9210a9.tar.gz
iced-ea7f2626b11af249510b27001fb6addd7f9210a9.tar.bz2
iced-ea7f2626b11af249510b27001fb6addd7f9210a9.zip
Optimized gradient data packing.
Diffstat (limited to 'wgpu/src/triangle.rs')
-rw-r--r--wgpu/src/triangle.rs26
1 files changed, 7 insertions, 19 deletions
diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs
index 6f32f182..3f633e14 100644
--- a/wgpu/src/triangle.rs
+++ b/wgpu/src/triangle.rs
@@ -652,28 +652,16 @@ mod gradient {
attributes: &wgpu::vertex_attr_array!(
// Position
0 => Float32x2,
- // 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,
+ // Colors 1-4
+ 1 => Uint32x4,
+ // Colors 5-8,
+ 2 => Uint32x4,
// Offsets 1-4
- 9 => Float32x4,
+ 3 => Float32x4,
// Offsets 5-8
- 10 => Float32x4,
+ 4 => Float32x4,
// Direction
- 11 => Float32x4
+ 5 => Float32x4
),
}],
},