Show `DXVK_FRAME_RATE` limit on hud if set
Check if DXVK_FRAME_RATE is set and uses it to show instead of fps limit:
This change is purely visual. Of course it does not check DXVK config.
Tested on Elite: Dangerous in following combinations:
- No
DXVK_FRAME_RATEvariable set and no config limit - showsFps limit [late]: 0 -
DXVK_FRAME_RATE=75and no config limit - shows like in screenshot - With
fps_limit=60in config andDXVK_FRAME_RATE=75-Fps limit [late]: 60 - The same as 3 but with
fps_limit_method=early- works as expected - The same as 3 but with
fps_limit_method=late- works as 3
You may think this implementation is rather dirty and environment read should be decoupled from the hud element. If so, you can simply close this PR and think it is a feature request, because C++ is not my main language and thus I'm not able to deep dive in this project in reasonable amount of time.
This should check if we're using dxvk by checking HUDElements.sw_stats->engine == EngineTypes::DXVK.
If both mangohud and dxvk has fps limit it should display which ever has the lowest limit set.
Not sure how to handle if both have the same limit, probably show dxvk?
I think in the same limit case we should show dxvk because in late case mangohud presents frame and waits with dxvk, then mangohud requests frame, dxvk creates it and mangohud instantly presents it, or in early case mangohud, I guess, gets frame, instatly shows it and waits for next frame from dxvk. But I may be wrong, I read about late/early limiter like 30 minutes ago. UPD: In this wall of text I forgot to write that, I think, DXVK uses late limiter: I see no inputlag from it.
I implemented dxvk engine check and ^, btw. And tested it, but not as thorough as in first PR (simply checked that it shows lowest limit).
P.s. I forgot to add "dxvk engine check" to commit message, so I think I'll squash it before merge.
Added a fix so that it still shows "Fps limit [late]: 0" if DXVK_FRAME_RATE is set to an invalid value and no fps limit is set in config. Sorry for interrupting actions (or it was a github bug, idk).
Can you squash the commits? Otherwise I think we're good
Also I found a bug by "squash verification" review: if there's no fps_limit in config, condition for showing dxvk won't be true (I tested it before fixing of course), so if(fpsDxvk > 0 && fpsDxvk <= fps) -> if(fpsDxvk > 0 && (!fps || fpsDxvk <= fps)). Squashed it as well and tested again: no fps_limit in config and it shows dxvk limit now.