File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -748,6 +748,10 @@ impl HelloTriangleApplication {
748748
749749 let command_buffer = self . command_buffers [ image_index] . clone ( ) ;
750750
751+ // we're joining on the previous future but the CPU is running faster than the GPU so
752+ // eventually it stutters, and jumps ahead to the newer frames.
753+ //
754+ // See vulkano issue 1135: https://github.com/vulkano-rs/vulkano/issues/1135
751755 let future = self . previous_frame_end . take ( ) . unwrap ( )
752756 . join ( acquire_future)
753757 . then_execute ( self . graphics_queue . clone ( ) , command_buffer)
@@ -757,6 +761,11 @@ impl HelloTriangleApplication {
757761
758762 match future {
759763 Ok ( future) => {
764+ // This makes sure the CPU stays in sync with the GPU in situations when the CPU is
765+ // running "too fast"
766+ #[ cfg( target_os = "macos" ) ]
767+ future. wait ( None ) . unwrap ( ) ;
768+
760769 self . previous_frame_end = Some ( Box :: new ( future) as Box < _ > ) ;
761770 }
762771 Err ( vulkano:: sync:: FlushError :: OutOfDate ) => {
You can’t perform that action at this time.
0 commit comments