Skip to content

Commit bb6e061

Browse files
authored
Merge pull request #925 from PolyMeilex/master
Update `wgpu` to `0.9`
2 parents e68da22 + a53e755 commit bb6e061

File tree

4 files changed

+21
-73
lines changed

4 files changed

+21
-73
lines changed

wgpu/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ qr_code = ["iced_graphics/qr_code"]
2626
default_system_font = ["iced_graphics/font-source"]
2727

2828
[dependencies]
29-
wgpu = "0.8"
30-
wgpu_glyph = "0.12"
29+
wgpu = "0.9"
30+
wgpu_glyph = "0.13"
3131
glyph_brush = "0.7"
3232
raw-window-handle = "0.3"
3333
log = "0.4"

wgpu/src/image.rs

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,13 @@ impl Pipeline {
165165
wgpu::VertexBufferLayout {
166166
array_stride: mem::size_of::<Instance>() as u64,
167167
step_mode: wgpu::InputStepMode::Instance,
168-
attributes: &[
169-
wgpu::VertexAttribute {
170-
shader_location: 1,
171-
format: wgpu::VertexFormat::Float32x2,
172-
offset: 0,
173-
},
174-
wgpu::VertexAttribute {
175-
shader_location: 2,
176-
format: wgpu::VertexFormat::Float32x2,
177-
offset: 4 * 2,
178-
},
179-
wgpu::VertexAttribute {
180-
shader_location: 3,
181-
format: wgpu::VertexFormat::Float32x2,
182-
offset: 4 * 4,
183-
},
184-
wgpu::VertexAttribute {
185-
shader_location: 4,
186-
format: wgpu::VertexFormat::Float32x2,
187-
offset: 4 * 6,
188-
},
189-
wgpu::VertexAttribute {
190-
shader_location: 5,
191-
format: wgpu::VertexFormat::Sint32,
192-
offset: 4 * 8,
193-
},
194-
],
168+
attributes: &wgpu::vertex_attr_array!(
169+
1 => Float32x2,
170+
2 => Float32x2,
171+
3 => Float32x2,
172+
4 => Float32x2,
173+
5 => Sint32,
174+
),
195175
},
196176
],
197177
},

wgpu/src/quad.rs

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -87,38 +87,14 @@ impl Pipeline {
8787
wgpu::VertexBufferLayout {
8888
array_stride: mem::size_of::<layer::Quad>() as u64,
8989
step_mode: wgpu::InputStepMode::Instance,
90-
attributes: &[
91-
wgpu::VertexAttribute {
92-
shader_location: 1,
93-
format: wgpu::VertexFormat::Float32x2,
94-
offset: 0,
95-
},
96-
wgpu::VertexAttribute {
97-
shader_location: 2,
98-
format: wgpu::VertexFormat::Float32x2,
99-
offset: 4 * 2,
100-
},
101-
wgpu::VertexAttribute {
102-
shader_location: 3,
103-
format: wgpu::VertexFormat::Float32x4,
104-
offset: 4 * (2 + 2),
105-
},
106-
wgpu::VertexAttribute {
107-
shader_location: 4,
108-
format: wgpu::VertexFormat::Float32x4,
109-
offset: 4 * (2 + 2 + 4),
110-
},
111-
wgpu::VertexAttribute {
112-
shader_location: 5,
113-
format: wgpu::VertexFormat::Float32,
114-
offset: 4 * (2 + 2 + 4 + 4),
115-
},
116-
wgpu::VertexAttribute {
117-
shader_location: 6,
118-
format: wgpu::VertexFormat::Float32,
119-
offset: 4 * (2 + 2 + 4 + 4 + 1),
120-
},
121-
],
90+
attributes: &wgpu::vertex_attr_array!(
91+
1 => Float32x2,
92+
2 => Float32x2,
93+
3 => Float32x4,
94+
4 => Float32x4,
95+
5 => Float32,
96+
6 => Float32,
97+
),
12298
},
12399
],
124100
},

wgpu/src/triangle.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,12 @@ impl Pipeline {
150150
buffers: &[wgpu::VertexBufferLayout {
151151
array_stride: mem::size_of::<Vertex2D>() as u64,
152152
step_mode: wgpu::InputStepMode::Vertex,
153-
attributes: &[
153+
attributes: &wgpu::vertex_attr_array!(
154154
// Position
155-
wgpu::VertexAttribute {
156-
shader_location: 0,
157-
format: wgpu::VertexFormat::Float32x2,
158-
offset: 0,
159-
},
155+
0 => Float32x2,
160156
// Color
161-
wgpu::VertexAttribute {
162-
shader_location: 1,
163-
format: wgpu::VertexFormat::Float32x4,
164-
offset: 4 * 2,
165-
},
166-
],
157+
1 => Float32x4,
158+
),
167159
}],
168160
},
169161
fragment: Some(wgpu::FragmentState {

0 commit comments

Comments
 (0)