@@ -69,22 +69,21 @@ impl RenderState {
6969 . unwrap ( ) ;
7070
7171 // Obtain the Configuration
72- let surface_caps = surface. get_capabilities ( & adapter) ;
73- let surface_format = surface_caps
74- . formats
72+ let surface_formats = surface. get_capabilities ( & adapter) . formats ;
73+ let surface_format = surface_formats
7574 . iter ( )
7675 . find ( |f| f. is_srgb ( ) )
77- . unwrap_or ( & surface_caps . formats [ 0 ] )
76+ . unwrap_or ( & surface_formats [ 0 ] )
7877 . clone ( ) ;
7978 let size = window. inner_size ( ) ;
8079 let config = SurfaceConfiguration {
8180 usage : TextureUsages :: RENDER_ATTACHMENT ,
8281 format : surface_format,
8382 width : size. width ,
8483 height : size. height ,
85- present_mode : surface_caps . present_modes [ 0 ] ,
86- alpha_mode : surface_caps . alpha_modes [ 0 ] ,
87- view_formats : vec ! [ ] ,
84+ present_mode : PresentMode :: AutoVsync ,
85+ alpha_mode : CompositeAlphaMode :: PreMultiplied ,
86+ view_formats : Vec :: new ( ) ,
8887 desired_maximum_frame_latency : 2 ,
8988 } ;
9089
@@ -133,7 +132,7 @@ impl RenderState {
133132 entry_point : Some ( "fs_main" ) ,
134133 targets : & [ Some ( ColorTargetState {
135134 format : surface_format,
136- blend : Some ( BlendState :: REPLACE ) ,
135+ blend : Some ( BlendState :: ALPHA_BLENDING ) ,
137136 write_mask : ColorWrites :: ALL ,
138137 } ) ] ,
139138 compilation_options : Default :: default ( ) ,
@@ -276,7 +275,7 @@ impl RenderState {
276275 mip_level_count : 1 ,
277276 sample_count : 1 ,
278277 dimension : TextureDimension :: D2 ,
279- format : TextureFormat :: Rgba8UnormSrgb ,
278+ format : TextureFormat :: Rgba8Unorm ,
280279 usage : TextureUsages :: TEXTURE_BINDING | TextureUsages :: COPY_DST ,
281280 view_formats : & [ ] ,
282281 } ,
@@ -312,17 +311,15 @@ impl RenderState {
312311 } ) ;
313312
314313 let mut render_pass = encoder. begin_render_pass ( & RenderPassDescriptor {
315- label : Some ( "Render Pass" ) ,
316314 color_attachments : & [ Some ( RenderPassColorAttachment {
317315 view : & view,
318316 ops : Operations {
319- load : LoadOp :: Clear ( Color :: BLACK ) ,
317+ load : unsafe { LoadOp :: DontCare ( LoadOpDontCare :: enabled ( ) ) } ,
320318 store : StoreOp :: Store ,
321319 } ,
322320 resolve_target : None ,
323321 depth_slice : None ,
324322 } ) ] ,
325- depth_stencil_attachment : None ,
326323 ..Default :: default ( )
327324 } ) ;
328325
0 commit comments