SpecialKO / SpecialK

Lovingly referred to as the Swiss Army Knife of PC gaming, Special K does a bit of everything.
https://www.special-k.info/
GNU General Public License v3.0
718 stars 45 forks source link

Added Adaptive VSync/Tearing options and enabled Latent Sync 2x.. modes #152

Open Nustat0 opened 3 months ago

Nustat0 commented 3 months ago

image image

Kaldaien commented 3 months ago

Adaptive (Prefer Off): only enables tearing if Render Latency exceeds 1 frame.

Does that even happen? Latent Sync is VSYNC off, I'm having a hard time picturing how render latency gets > 1 frame.

This seems more like a feature appropriate for non-Latent Sync modes. I like the premise of letting the screen tear for 1 or more frames until latency comes down for fixed-refresh users, a lot, but I don't think that's a problem that Latent Sync has to begin with.

Nustat0 commented 3 months ago

Does that even happen? Latent Sync is VSYNC off, I'm having a hard time picturing how render latency gets > 1 frame.

It happens when Latent Sync is used with Allow Tearing option unchecked. With tearing disabled, Latent Sync acts similarly to VSync and increases Render Latency in some scenarios (gets "stuck" above 1 frame after experiencing loading screens, sudden frame drops, loss of Independent Flip).

You can easily reproduce it by enabling Latent Sync, disabling tearing and temporarily losing Independent Flip. When presentation mode transitions from Composed Flip to Independent Flip, Render Latency rises above 1 frame.

I only tested this on a fixed-refresh 60 Hz monitor, maybe it's less of an issue on higher refresh rates?

This seems more like a feature appropriate for non-Latent Sync modes. I like the premise of letting the screen tear for 1 or more frames until latency comes down for fixed-refresh users, a lot, but I don't think that's a problem that Latent Sync has to begin with.

In non-Latent Sync mode, especially fixed-refresh VSync, you'd have to toggle presentation interval to 0/1 which goes back and forth between Latent Sync and Normal modes. That's why I restricted Adaptive Tearing modes to Latent Sync - presentation interval stays the same (0) and it's simply easier toggling tearing On/Off.

Nustat0 commented 3 months ago

This seems more like a feature appropriate for non-Latent Sync modes. I like the premise of letting the screen tear for 1 or more frames until latency comes down for fixed-refresh users, a lot, but I don't think that's a problem that Latent Sync has to begin with.

In non-Latent Sync mode, especially fixed-refresh VSync, you'd have to toggle presentation interval to 0/1 which goes back and forth between Latent Sync and Normal modes. That's why I restricted Adaptive Tearing modes to Latent Sync - presentation interval stays the same (0) and it's simply easier toggling tearing On/Off.

Update: I also implemented Adaptive VSync mode for non-Latent-Sync usage. It temporarily turns VSync Off / Tearing On (without enabling Latent Sync) if FPS is unstable or Render Latency exceeds 1 frame.

Nustat0 commented 3 days ago

Marked as draft. I'm finishing off another Tearing Mode "Always Off (Low Latency)" (temporarily lowers FPS limit if Render Latency exceeds 1 frame) :)