doitsujin / dxvk

Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine
zlib License
12.25k stars 783 forks source link

Possible combination of options in dxvk.conf #4049

Closed Tiagoquix closed 4 weeks ago

Tiagoquix commented 1 month ago

Hello there.

In the file https://github.com/doitsujin/dxvk/blob/master/dxvk.conf, there are some "duplicate" options for Direct3D 9 (d3d9) and Direct3D 10+ (dxgi).

Examples:

https://github.com/doitsujin/dxvk/blob/c2fd91f835741d7f38a1b7af8b982935dfbad241/dxvk.conf#L34-L41

https://github.com/doitsujin/dxvk/blob/c2fd91f835741d7f38a1b7af8b982935dfbad241/dxvk.conf#L44-L53

Forgive my ignorance here, but as I understand it, it seems there is no real utility for keeping them separate.

So I ask: wouldn't it be more simpler (and even somewhat more useful) to have a unique option?

Example: instead of having dxgi.maxFrameRate and d3d9.maxFrameRate, we could only have dxvk.maxFrameRate, with the same logic. Then, the user chooses the desired value and DXVK does the work of knowing if the game is D3D9/10/11. Same logic would apply to other options.

Is there a reason for this combination not to exist?

Thanks in advance for your attention.

doitsujin commented 1 month ago

It has been considered, but it also breaks existing configurations, and in some cases, games that support both APIs only require options for one but not the other.

lextra2 commented 1 month ago

And what about keeping the old, but adding a new, shorter option?

Example: dxgi.maxFrameRate & d3d9.maxFrameRate gets a third variable, maxFrameRate (effectively adjusting both, dxgi and dx9)

Would be less clutter for users with a custom config Another positive is, the user doesn't have to figure out first, what directX version the game uses.

Tiagoquix commented 1 month ago

It has been considered, but it also breaks existing configurations

You could just start recommending the new unified option and keep the previous ones as aliases.

games that support both APIs only require options for one but not the other.

That's weird. In this case, couldn't DXVK figure out what's the best option to apply (d3d9 or dxgi) and then proceed from there?

If DXVK can't determine it, then would it be possible to just apply both options, or would that a cause a problem?

doitsujin commented 4 weeks ago

That's weird. In this case, couldn't DXVK figure out what's the best option to apply (d3d9 or dxgi) and then proceed from there?

What I mean is something like the D3D9 version of a game requiring a vendor override but not the D3D11 one (or vice versa). We cannot differentiate between API versions if we merge the options.

Tiagoquix commented 4 weeks ago

Ah yes, I understand now. What we could do would be to unify the simpler options that wouldn't cause problems (such as max. frame rate), giving the idea of ​​"this option applies to all APIs".

For D3D9 or DXGI-only options (i.e. options that only exists for one API, but not for the other), then I think it's fine to remain as it is to keep the differentiation.

The main idea here is to unify simpler options (that hopefully wouldn't cause any problems when merged) with the goal of reducing "duplicates". We would use the prefix "dxvk" for the merged ones.

In cases such as the one you mentioned about vendors we would keep the options as-is.

Tiagoquix commented 4 weeks ago

And what about keeping the old, but adding a new, shorter option?

Example: dxgi.maxFrameRate & d3d9.maxFrameRate gets a third variable, maxFrameRate (effectively adjusting both, dxgi and dx9)

Would be less clutter for users with a custom config Another positive is, the user doesn't have to figure out first, what directX version the game uses.

That's my idea, but using the prefix "dxvk", so it would be "dxvk.maxFrameRate", at the same time that the old ones would still work as aliases (to avoid breaking old configs), but only the new ones with the "dxvk" prefix would be recommended going forward. This sure would help newcomers.

Tiagoquix commented 4 weeks ago

In reality, thinking more about the subject, it is possible that the logic of having different options with different values ​​for different APIs in a single game is something important, as it may be that one option applies to an API and another does not, as is the case with case of the Vendor option, and this may also apply to others.

After this reflection, the only one that I see as possible to unify would be the max. frame rate option.

If @doitsujin agrees, I'll close this issue and create another just to unify the frame rate option, while keeping the others as they are.

Blisto91 commented 4 weeks ago

fwiw there is already a unified limit frame rate option via the environment variable DXVK_FRAME_RATE. For the most part it is not expected that users should mess with the config options. They are mostly there for debug purposes or working around issues.

Tiagoquix commented 4 weeks ago

After thinking more about it, I agree that we should leave the max. FPS options separate. There may be a case where a game has a problem in DX9, but not in DX11 (and vice-versa). Some of the workarounds developers make in certain games when creating renders in DirectX are quite unique, and we should have the possibility to adapt for this kind of case if it's necessary (which we have now).

Considering the env. variable DXVK_FRAME_RATE: yeah, that solves the problem, and it's simpler for newcomers.

Thank you all for your feedback. Have a good day.