@@ -131,34 +131,31 @@ impl crate::framework::Example for Example {
131131
132132 // Create pipeline layout
133133 let bind_group_layout = device. create_bind_group_layout ( & wgpu:: BindGroupLayoutDescriptor {
134- label : None ,
135134 entries : & [
136135 wgpu:: BindGroupLayoutEntry {
137136 binding : 0 ,
138137 visibility : wgpu:: ShaderStages :: VERTEX ,
139138 ty : wgpu:: BindingType :: Buffer {
140- ty : wgpu:: BufferBindingType :: Uniform ,
141- has_dynamic_offset : false ,
142139 min_binding_size : wgpu:: BufferSize :: new ( 64 ) ,
140+ ..
143141 } ,
144142 count : None ,
145143 } ,
146144 wgpu:: BindGroupLayoutEntry {
147145 binding : 1 ,
148146 visibility : wgpu:: ShaderStages :: FRAGMENT ,
149147 ty : wgpu:: BindingType :: Texture {
150- multisampled : false ,
151148 sample_type : wgpu:: TextureSampleType :: Uint ,
152- view_dimension : wgpu :: TextureViewDimension :: D2 ,
149+ ..
153150 } ,
154151 count : None ,
155152 } ,
156153 ] ,
154+ ..
157155 } ) ;
158156 let pipeline_layout = device. create_pipeline_layout ( & wgpu:: PipelineLayoutDescriptor {
159- label : None ,
160157 bind_group_layouts : & [ Some ( & bind_group_layout) ] ,
161- immediate_size : 0 ,
158+ ..
162159 } ) ;
163160
164161 // Create the texture
@@ -167,26 +164,23 @@ impl crate::framework::Example for Example {
167164 let texture_extent = wgpu:: Extent3d {
168165 width : size,
169166 height : size,
170- depth_or_array_layers : 1 ,
167+ ..
171168 } ;
172169 let texture = device. create_texture ( & wgpu:: TextureDescriptor {
173170 label : None ,
174171 size : texture_extent,
175- mip_level_count : 1 ,
176- sample_count : 1 ,
177- dimension : wgpu:: TextureDimension :: D2 ,
178172 format : wgpu:: TextureFormat :: R8Uint ,
179173 usage : wgpu:: TextureUsages :: TEXTURE_BINDING | wgpu:: TextureUsages :: COPY_DST ,
180174 view_formats : & [ ] ,
175+ ..
181176 } ) ;
182177 let texture_view = texture. create_view ( & wgpu:: TextureViewDescriptor :: default ( ) ) ;
183178 queue. write_texture (
184179 texture. as_image_copy ( ) ,
185180 & texels,
186181 wgpu:: TexelCopyBufferLayout {
187- offset : 0 ,
188182 bytes_per_row : Some ( size) ,
189- rows_per_image : None ,
183+ ..
190184 } ,
191185 texture_extent,
192186 ) ;
@@ -220,7 +214,6 @@ impl crate::framework::Example for Example {
220214
221215 let vertex_buffers = [ wgpu:: VertexBufferLayout {
222216 array_stride : vertex_size as wgpu:: BufferAddress ,
223- step_mode : wgpu:: VertexStepMode :: Vertex ,
224217 attributes : & [
225218 wgpu:: VertexAttribute {
226219 format : wgpu:: VertexFormat :: Float32x4 ,
@@ -233,73 +226,65 @@ impl crate::framework::Example for Example {
233226 shader_location : 1 ,
234227 } ,
235228 ] ,
229+ ..
236230 } ] ;
237231
238232 let pipeline = device. create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
239- label : None ,
240233 layout : Some ( & pipeline_layout) ,
241234 vertex : wgpu:: VertexState {
242235 module : & shader,
243236 entry_point : Some ( "vs_main" ) ,
244- compilation_options : Default :: default ( ) ,
245237 buffers : & vertex_buffers,
238+ ..
246239 } ,
247240 fragment : Some ( wgpu:: FragmentState {
248241 module : & shader,
249242 entry_point : Some ( "fs_main" ) ,
250- compilation_options : Default :: default ( ) ,
251243 targets : & [ Some ( config. view_formats [ 0 ] . into ( ) ) ] ,
244+ ..
252245 } ) ,
253246 primitive : wgpu:: PrimitiveState {
254247 cull_mode : Some ( wgpu:: Face :: Back ) ,
255- ..Default :: default ( )
248+ ..
256249 } ,
257- depth_stencil : None ,
258- multisample : wgpu:: MultisampleState :: default ( ) ,
259- multiview_mask : None ,
260- cache : None ,
250+ ..
261251 } ) ;
262252
263253 let pipeline_wire = if device
264254 . features ( )
265255 . contains ( wgpu:: Features :: POLYGON_MODE_LINE )
266256 {
267257 let pipeline_wire = device. create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
268- label : None ,
269258 layout : Some ( & pipeline_layout) ,
270259 vertex : wgpu:: VertexState {
271260 module : & shader,
272261 entry_point : Some ( "vs_main" ) ,
273- compilation_options : Default :: default ( ) ,
274262 buffers : & vertex_buffers,
263+ ..
275264 } ,
276265 fragment : Some ( wgpu:: FragmentState {
277266 module : & shader,
278267 entry_point : Some ( "fs_wire" ) ,
279- compilation_options : Default :: default ( ) ,
280268 targets : & [ Some ( wgpu:: ColorTargetState {
281269 format : config. view_formats [ 0 ] ,
282270 blend : Some ( wgpu:: BlendState {
283271 color : wgpu:: BlendComponent {
284- operation : wgpu:: BlendOperation :: Add ,
285272 src_factor : wgpu:: BlendFactor :: SrcAlpha ,
286273 dst_factor : wgpu:: BlendFactor :: OneMinusSrcAlpha ,
274+ ..
287275 } ,
288276 alpha : wgpu:: BlendComponent :: REPLACE ,
289277 } ) ,
290- write_mask : wgpu :: ColorWrites :: ALL ,
278+ ..
291279 } ) ] ,
280+ ..
292281 } ) ,
293282 primitive : wgpu:: PrimitiveState {
294- front_face : wgpu:: FrontFace :: Ccw ,
295283 cull_mode : Some ( wgpu:: Face :: Back ) ,
296284 polygon_mode : wgpu:: PolygonMode :: Line ,
297- ..Default :: default ( )
285+ ..
298286 } ,
299- depth_stencil : None ,
300- multisample : wgpu:: MultisampleState :: default ( ) ,
301- multiview_mask : None ,
302- cache : None ,
287+ ..
303288 } ) ;
304289 Some ( pipeline_wire)
305290 } else {
@@ -338,11 +323,8 @@ impl crate::framework::Example for Example {
338323 device. create_command_encoder ( & wgpu:: CommandEncoderDescriptor { label : None } ) ;
339324 {
340325 let mut rpass = encoder. begin_render_pass ( & wgpu:: RenderPassDescriptor {
341- label : None ,
342326 color_attachments : & [ Some ( wgpu:: RenderPassColorAttachment {
343327 view,
344- depth_slice : None ,
345- resolve_target : None ,
346328 ops : wgpu:: Operations {
347329 load : wgpu:: LoadOp :: Clear ( wgpu:: Color {
348330 r : 0.1 ,
@@ -352,11 +334,9 @@ impl crate::framework::Example for Example {
352334 } ) ,
353335 store : wgpu:: StoreOp :: Store ,
354336 } ,
337+ ..
355338 } ) ] ,
356- depth_stencil_attachment : None ,
357- timestamp_writes : None ,
358- occlusion_query_set : None ,
359- multiview_mask : None ,
339+ ..
360340 } ) ;
361341 rpass. push_debug_group ( "Prepare data for draw." ) ;
362342 rpass. set_pipeline ( & self . pipeline ) ;
0 commit comments