@@ -801,6 +801,7 @@ pub enum MonitorSelection {
801
801
/// [`Immediate`] or [`Mailbox`] will panic if not supported by the platform.
802
802
///
803
803
/// [`Fifo`]: PresentMode::Fifo
804
+ /// [`FifoRelaxed`]: PresentMode::FifoRelaxed
804
805
/// [`Immediate`]: PresentMode::Immediate
805
806
/// [`Mailbox`]: PresentMode::Mailbox
806
807
/// [`AutoVsync`]: PresentMode::AutoVsync
@@ -819,30 +820,67 @@ pub enum PresentMode {
819
820
/// Chooses FifoRelaxed -> Fifo based on availability.
820
821
///
821
822
/// Because of the fallback behavior, it is supported everywhere.
822
- AutoVsync = 0 ,
823
+ AutoVsync = 0 , // NOTE: The explicit ordinal values mirror wgpu.
823
824
/// Chooses Immediate -> Mailbox -> Fifo (on web) based on availability.
824
825
///
825
826
/// Because of the fallback behavior, it is supported everywhere.
826
827
AutoNoVsync = 1 ,
827
- /// The presentation engine does **not** wait for a vertical blanking period and
828
- /// the request is presented immediately. This is a low-latency presentation mode,
829
- /// but visible tearing may be observed. Not optimal for mobile.
830
- ///
831
- /// Selecting this variant will panic if not supported, it is preferred to use
832
- /// [`PresentMode::AutoNoVsync`].
833
- Immediate = 2 ,
834
- /// The presentation engine waits for the next vertical blanking period to update
835
- /// the current image, but frames may be submitted without delay. This is a low-latency
836
- /// presentation mode and visible tearing will **not** be observed. Not optimal for mobile.
837
- ///
838
- /// Selecting this variant will panic if not supported, it is preferred to use
839
- /// [`PresentMode::AutoNoVsync`].
840
- Mailbox = 3 ,
841
- /// The presentation engine waits for the next vertical blanking period to update
842
- /// the current image. The framerate will be capped at the display refresh rate,
843
- /// corresponding to the `VSync`. Tearing cannot be observed. Optimal for mobile.
828
+ /// Presentation frames are kept in a First-In-First-Out queue approximately 3 frames
829
+ /// long. Every vertical blanking period, the presentation engine will pop a frame
830
+ /// off the queue to display. If there is no frame to display, it will present the same
831
+ /// frame again until the next vblank.
832
+ ///
833
+ /// When a present command is executed on the gpu, the presented image is added on the queue.
834
+ ///
835
+ /// No tearing will be observed.
836
+ ///
837
+ /// Calls to get_current_texture will block until there is a spot in the queue.
838
+ ///
839
+ /// Supported on all platforms.
840
+ ///
841
+ /// If you don't know what mode to choose, choose this mode. This is traditionally called "Vsync On".
844
842
#[ default]
845
- Fifo = 4 , // NOTE: The explicit ordinal values mirror wgpu.
843
+ Fifo = 2 ,
844
+ /// Presentation frames are kept in a First-In-First-Out queue approximately 3 frames
845
+ /// long. Every vertical blanking period, the presentation engine will pop a frame
846
+ /// off the queue to display. If there is no frame to display, it will present the
847
+ /// same frame until there is a frame in the queue. The moment there is a frame in the
848
+ /// queue, it will immediately pop the frame off the queue.
849
+ ///
850
+ /// When a present command is executed on the gpu, the presented image is added on the queue.
851
+ ///
852
+ /// Tearing will be observed if frames last more than one vblank as the front buffer.
853
+ ///
854
+ /// Calls to get_current_texture will block until there is a spot in the queue.
855
+ ///
856
+ /// Supported on AMD on Vulkan.
857
+ ///
858
+ /// This is traditionally called "Adaptive Vsync"
859
+ FifoRelaxed = 3 ,
860
+ /// Presentation frames are not queued at all. The moment a present command
861
+ /// is executed on the GPU, the presented image is swapped onto the front buffer
862
+ /// immediately.
863
+ ///
864
+ /// Tearing can be observed.
865
+ ///
866
+ /// Supported on most platforms except older DX12 and Wayland.
867
+ ///
868
+ /// This is traditionally called "Vsync Off".
869
+ Immediate = 4 ,
870
+ /// Presentation frames are kept in a single-frame queue. Every vertical blanking period,
871
+ /// the presentation engine will pop a frame from the queue. If there is no frame to display,
872
+ /// it will present the same frame again until the next vblank.
873
+ ///
874
+ /// When a present command is executed on the gpu, the frame will be put into the queue.
875
+ /// If there was already a frame in the queue, the new frame will _replace_ the old frame
876
+ /// on the queue.
877
+ ///
878
+ /// No tearing will be observed.
879
+ ///
880
+ /// Supported on DX11/12 on Windows 10, NVidia on Vulkan and Wayland on Vulkan.
881
+ ///
882
+ /// This is traditionally called "Fast Vsync"
883
+ Mailbox = 5 ,
846
884
}
847
885
848
886
/// Specifies how the alpha channel of the textures should be handled during compositing, for a [`Window`].
0 commit comments