File tree 4 files changed +21
-73
lines changed 4 files changed +21
-73
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ qr_code = ["iced_graphics/qr_code"]
26
26
default_system_font = [" iced_graphics/font-source" ]
27
27
28
28
[dependencies ]
29
- wgpu = " 0.8 "
30
- wgpu_glyph = " 0.12 "
29
+ wgpu = " 0.9 "
30
+ wgpu_glyph = " 0.13 "
31
31
glyph_brush = " 0.7"
32
32
raw-window-handle = " 0.3"
33
33
log = " 0.4"
Original file line number Diff line number Diff line change @@ -165,33 +165,13 @@ impl Pipeline {
165
165
wgpu:: VertexBufferLayout {
166
166
array_stride : mem:: size_of :: < Instance > ( ) as u64 ,
167
167
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
+ ) ,
195
175
} ,
196
176
] ,
197
177
} ,
Original file line number Diff line number Diff line change @@ -87,38 +87,14 @@ impl Pipeline {
87
87
wgpu:: VertexBufferLayout {
88
88
array_stride : mem:: size_of :: < layer:: Quad > ( ) as u64 ,
89
89
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
+ ) ,
122
98
} ,
123
99
] ,
124
100
} ,
Original file line number Diff line number Diff line change @@ -150,20 +150,12 @@ impl Pipeline {
150
150
buffers : & [ wgpu:: VertexBufferLayout {
151
151
array_stride : mem:: size_of :: < Vertex2D > ( ) as u64 ,
152
152
step_mode : wgpu:: InputStepMode :: Vertex ,
153
- attributes : & [
153
+ attributes : & wgpu :: vertex_attr_array! (
154
154
// Position
155
- wgpu:: VertexAttribute {
156
- shader_location : 0 ,
157
- format : wgpu:: VertexFormat :: Float32x2 ,
158
- offset : 0 ,
159
- } ,
155
+ 0 => Float32x2 ,
160
156
// Color
161
- wgpu:: VertexAttribute {
162
- shader_location : 1 ,
163
- format : wgpu:: VertexFormat :: Float32x4 ,
164
- offset : 4 * 2 ,
165
- } ,
166
- ] ,
157
+ 1 => Float32x4 ,
158
+ ) ,
167
159
} ] ,
168
160
} ,
169
161
fragment : Some ( wgpu:: FragmentState {
You can’t perform that action at this time.
0 commit comments