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

[Enhancement] Controlling Nvidia ReBar via SK #148

Open marat569 opened 4 months ago

marat569 commented 4 months ago

Intro: The concept is simple -- enabling nvidia rebar, which is only 1-3 profile slots, via SK on a per game basis. This would ideally be handled similar to how the current gsync on/off feature works; since its just reading/writing profile values. Rebar can provide up to a +10% perf boost when it works, and usually doesn't have any downsides when it doesn't work.

Nvidia doesn't always whitelist all games that use rebar texture streaming. An example is The Evil Within 2 -- it gets almost +20% perf forcing rebar because it uses a fork of idtech's engine -- but nvidia never whitelisted the game. There are tons of games that benefit from rebar, but are not whitelisted by nvidia. Many end up getting whitelisted only because the community discovers that there is a perf boost, Starfield is a good example, and then nvidia ships an updated profile.

What to do: We only really need to change 1 Value in the game's profile on recent drivers: rBar Feature: enabled image

You can also change rbar options and size limit; but those seem to have been automatically set for us now to previous default values; so only the on/off profile value needs to be changed

An ideal implementation would be a menu in the SK UI that would let us either check rebar on/off, and maybe change the secondary options -- even though they're not really important

Important Considerations

Here is an example image of how rebar looks when nvidia sets it (returnal's profile) Note: Returnal uses extra features we don't need, just sharing an example image image

Here is Starfield's profile (nvidia whitelisted): See how only rBAR Feature is enabled image

Conclusion: Having a quick way to enable rebar on a per game basis via SK would be really handy. Its kinda annoying going to the profile inspector every time. It's only one read/write to the game's profile; and a UI element in SK. Feels like another handy tool to have in SK's toolbelt! Free perf never hurts!

Thank you!

Kaldaien commented 4 months ago

Judging by the screenshots, that's 3 things that have to be written and all 3 of them are undocumented.

Writing this driver setting also requires elevation to administrator, making it much different than the G-Sync / FastSync settings available in the control panel.

rundll32 "SpecialK64.dll", RunDLL_NvAPI_SetDWORD 0x000F00BA 0x1 <executable.exe>

That will enable it (if run as an administrator), but I've got no idea what to do about the size or options.

marat569 commented 4 months ago

So the size and options are no longer needed

You only need to rbar -feature on/off

Size/Option USED to be required on older drivers; but nvidia streamlined things; and made them specific to only a few games.

Imo SK shouldn't edit Options or Size limit, at least on the recent drivers that only require rBar - Feature -- Enabled