@@ -203,10 +203,10 @@ impl ApplicationHandler<UserEvent> for VelloApp<'_> {
203203 self . state = {
204204 let render_state = RenderState { window, surface } ;
205205 self . renderers
206- . resize_with ( self . context . devices . len ( ) , || None ) ;
206+ . resize_with ( self . context . device_pool . len ( ) , || None ) ;
207207 let id = render_state. surface . dev_id ;
208208 self . renderers [ id] . get_or_insert_with ( || {
209- let device_handle = & self . context . devices [ id] ;
209+ let device_handle = & self . context . device_pool [ id] ;
210210 let cache = if let Some ( ( dir, tx) ) = self . cache_data . as_ref ( ) {
211211 // Safety: Hoping for the best. Given that we're using as private a cache directory as possible, it's
212212 // probably fine?
@@ -349,14 +349,11 @@ impl ApplicationHandler<UserEvent> for VelloApp<'_> {
349349 }
350350 "v" => {
351351 self . vsync_on = !self . vsync_on ;
352- self . context . set_present_mode (
353- & mut render_state. surface ,
354- if self . vsync_on {
355- wgpu:: PresentMode :: AutoVsync
356- } else {
357- wgpu:: PresentMode :: AutoNoVsync
358- } ,
359- ) ;
352+ render_state. surface . set_present_mode ( if self . vsync_on {
353+ wgpu:: PresentMode :: AutoVsync
354+ } else {
355+ wgpu:: PresentMode :: AutoNoVsync
356+ } ) ;
360357 }
361358 debug_layer @ ( "1" | "2" | "3" | "4" ) => {
362359 match debug_layer {
@@ -426,8 +423,7 @@ impl ApplicationHandler<UserEvent> for VelloApp<'_> {
426423 }
427424 WindowEvent :: Resized ( size) => {
428425 if let Some ( RenderState { surface, window } ) = & mut self . state {
429- self . context
430- . resize_surface ( surface, size. width , size. height ) ;
426+ surface. resize ( size. width , size. height ) ;
431427 window. request_redraw ( ) ;
432428 }
433429 }
@@ -481,7 +477,7 @@ impl ApplicationHandler<UserEvent> for VelloApp<'_> {
481477 } ;
482478 let width = surface. config . width ;
483479 let height = surface. config . height ;
484- let device_handle = & self . context . devices [ surface. dev_id ] ;
480+ let device_handle = & self . context . device_pool [ surface. dev_id ] ;
485481 let snapshot = self . stats . snapshot ( ) ;
486482
487483 // Allow looping forever
@@ -671,7 +667,7 @@ impl ApplicationHandler<UserEvent> for VelloApp<'_> {
671667 let Some ( render_state) = & mut self . state else {
672668 return ;
673669 } ;
674- let device_handle = & self . context . devices [ render_state. surface . dev_id ] ;
670+ let device_handle = & self . context . device_pool [ render_state. surface . dev_id ] ;
675671 log:: info!( "==============\n Reloading shaders" ) ;
676672 let start = Instant :: now ( ) ;
677673 let result = self . renderers [ render_state. surface . dev_id ]
@@ -717,9 +713,9 @@ fn run(
717713 #[ cfg( target_arch = "wasm32" ) ]
718714 let ( render_state, renderers) = {
719715 let mut renderers = vec ! [ ] ;
720- renderers. resize_with ( render_cx. devices . len ( ) , || None ) ;
716+ renderers. resize_with ( render_cx. device_pool . len ( ) , || None ) ;
721717 let id = render_state. surface . dev_id ;
722- let device_handle = & render_cx. devices [ id] ;
718+ let device_handle = & render_cx. device_pool [ id] ;
723719 let cache: Option < ( PipelineCache , PathBuf ) > = if let Some ( dir) = cache_directory. as_ref ( ) {
724720 // Safety: Hoping for the best. Given that we're using as private a cache directory as possible, it's
725721 // probably fine?
0 commit comments