Skip to content

Commit

Permalink
fix: NVAPI overriding dxvk.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
koplo199 authored and orowith2os committed Nov 28, 2023
1 parent fa4657b commit fefbdab
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions bottles/backend/wine/winecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ def get_env(self, environment: dict = {}, return_steam_env: bool = False, return

# DXVK-Nvapi environment variables
if params.dxvk_nvapi and not return_steam_env:
conf = self.__set_dxvk_nvapi_conf(bottle)
env.add("DXVK_CONFIG_FILE", conf)
# NOTE: users reported that DXVK_ENABLE_NVAPI and DXVK_NVAPIHACK must be set to make
# DLSS works. I don't have a GPU compatible with this tech, so I'll trust them
env.add("DXVK_NVAPIHACK", "0")
Expand Down Expand Up @@ -696,26 +694,3 @@ def run(self) -> Result[Optional[str]]:

return Result(True, data=rv)

@staticmethod
def __set_dxvk_nvapi_conf(bottle: str):
"""
TODO: This should be moved to a dedicated DXVKConf class when
we will provide a way to set the DXVK configuration.
"""
dxvk_conf = f"{bottle}/dxvk.conf"
if not os.path.exists(dxvk_conf):
# create dxvk.conf if it doesn't exist
with open(dxvk_conf, "w") as f:
f.write("dxgi.nvapiHack = False")
else:
# check if dxvk.conf has the nvapiHack option, if not add it
with open(dxvk_conf, "r") as f:
lines = f.readlines()
with open(dxvk_conf, "w") as f:
for line in lines:
if "dxgi.nvapiHack" in line:
f.write("dxgi.nvapiHack = False\n")
else:
f.write(line)

return dxvk_conf

0 comments on commit fefbdab

Please sign in to comment.