Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 36 additions & 26 deletions Whisky/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -8978,28 +8978,6 @@
}
}
},
"Rockstar Games Launcher shows no window without DXVK. When it is this bottle's launcher, the bottle switches to DXVK on detection and every program in it runs with DXVK, whatever Graphics Backend is set to. Other launchers already run on DXVK under the Recommended backend." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Rockstar Games Launcher shows no window without DXVK. When it is this bottle's launcher, the bottle switches to DXVK on detection and every program in it runs with DXVK, whatever Graphics Backend is set to. Other launchers already run on DXVK under the Recommended backend."
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "Rockstar Games Launcher shows no window without DXVK. When it is this bottle's launcher, the bottle switches to DXVK on detection and every program in it runs with DXVK, whatever Graphics Backend is set to. Other launchers already run on DXVK under the Recommended backend."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "没有 DXVK 时 Rockstar Games Launcher 不显示窗口。当它作为此容器的启动器时,容器一经检测到就会切换到 DXVK,容器内所有程序都使用 DXVK,无论图形后端设置为何。其他启动器在“推荐”后端下本已使用 DXVK。"
}
}
}
},
"Run Diagnostics" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -11740,6 +11718,22 @@
}
}
},
"Without the Game Porting Toolkit, a bottle whose launcher is the Rockstar Games Launcher switches to DXVK on detection, and every program in it except the launcher itself runs with DXVK, whatever Graphics Backend is set to. The launcher draws with Wine's own Direct3D either way, and with the Game Porting Toolkit installed this setting does nothing. Other launchers already run on DXVK under the Recommended backend." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Without the Game Porting Toolkit, a bottle whose launcher is the Rockstar Games Launcher switches to DXVK on detection, and every program in it except the launcher itself runs with DXVK, whatever Graphics Backend is set to. The launcher draws with Wine's own Direct3D either way, and with the Game Porting Toolkit installed this setting does nothing. Other launchers already run on DXVK under the Recommended backend."
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "Without the Game Porting Toolkit, a bottle whose launcher is the Rockstar Games Launcher switches to DXVK on detection, and every program in it except the launcher itself runs with DXVK, whatever Graphics Backend is set to. The launcher draws with Wine's own Direct3D either way, and with the Game Porting Toolkit installed this setting does nothing. Other launchers already run on DXVK under the Recommended backend."
}
}
}
},
"accessibility.launcherBanner %@ %lld" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -59544,13 +59538,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "With GPTK installed, the Rockstar Games Launcher draws only with Wine's own Direct3D, not with DXVK. Whisky puts Wine's d3d11.dll in this bottle's system folder and gives Steam and Social Club their own copies of DXVK. It cannot while every program in the bottle runs on DXVK, as Use DXVK for Rockstar Games Launcher makes them do in a bottle whose launcher is Rockstar's. Turn this off to keep DXVK in the system folder."
"value" : "With GPTK installed, the Rockstar Games Launcher draws only with Wine's own Direct3D, not with DXVK. Whisky puts Wine's d3d11.dll in this bottle's system folder and gives Steam and Social Club their own copies of DXVK. It cannot while every program in the bottle loads DXVK, from its Graphics Backend or a DLL override. Turn this off to keep DXVK in the system folder."
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "With GPTK installed, the Rockstar Games Launcher draws only with Wine's own Direct3D, not with DXVK. Whisky puts Wine's d3d11.dll in this bottle's system folder and gives Steam and Social Club their own copies of DXVK. It cannot while every program in the bottle runs on DXVK, as Use DXVK for Rockstar Games Launcher makes them do in a bottle whose launcher is Rockstar's. Turn this off to keep DXVK in the system folder."
"value" : "With GPTK installed, the Rockstar Games Launcher draws only with Wine's own Direct3D, not with DXVK. Whisky puts Wine's d3d11.dll in this bottle's system folder and gives Steam and Social Club their own copies of DXVK. It cannot while every program in the bottle loads DXVK, from its Graphics Backend or a DLL override. Turn this off to keep DXVK in the system folder."
}
},
"zh-Hans" : {
Expand Down Expand Up @@ -59588,13 +59582,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Not applied: every program in this bottle loads native Direct3D 11 (DXVK or DXMT), from its Graphics Backend, a DLL override, or Use DXVK for Rockstar Games Launcher."
"value" : "Not applied: every program in this bottle loads native Direct3D 11 (DXVK or DXMT), from its Graphics Backend or a DLL override. Set Graphics Backend to Recommended, and remove any native d3d11 DLL override."
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "Not applied: every program in this bottle loads native Direct3D 11 (DXVK or DXMT), from its Graphics Backend, a DLL override, or Use DXVK for Rockstar Games Launcher."
"value" : "Not applied: every program in this bottle loads native Direct3D 11 (DXVK or DXMT), from its Graphics Backend or a DLL override. Set Graphics Backend to Recommended, and remove any native d3d11 DLL override."
}
},
"zh-Hans" : {
Expand Down Expand Up @@ -63047,6 +63041,22 @@
}
}
},
"config.graphics.backend.launcherReset.rockstar" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This bottle is back on Recommended. The Rockstar Games Launcher gets its own Direct3D now, so its games keep D3DMetal."
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "This bottle is back on Recommended. The Rockstar Games Launcher gets its own Direct3D now, so its games keep D3DMetal."
}
}
}
},
"config.graphics.chromiumOnExplicitBackend %@" : {
"localizations" : {
"en" : {
Expand Down
26 changes: 13 additions & 13 deletions Whisky/Views/Bottle/DLLOverrideConfigSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ struct DLLOverrideConfigSection: View {
managed.append(ManagedOverride(entry: entry, source: backendSource, label: backend.displayName))
}

// Launcher managed entries (when launcher requires DXVK and autoEnableDXVK is on)
if bottle.settings.launcherCompatibilityMode,
bottle.settings.autoEnableDXVK,
let launcher = bottle.settings.detectedLauncher,
launcher.requiresDXVK {
for entry in DLLOverrideResolver.dxvkPreset(builtinD3D12IsD3DMetal: builtinD3D12IsD3DMetal)
where !managed.contains(where: { $0.entry.dllName == entry.dllName }) {
managed.append(ManagedOverride(
entry: entry,
source: .launcher(launcher.displayName),
label: String(localized: "config.dllOverrides.source.launcher")
))
}
// Launcher managed entries: the ones the launch itself adds, so none
// are listed with the GPTK payload, where it adds none (#408)
var builder = EnvironmentBuilder()
let launcherEntries = bottle.settings.populateLauncherManagedLayer(
builder: &builder, builtinD3D12IsD3DMetal: builtinD3D12IsD3DMetal
)
for (entry, source) in launcherEntries
where !managed.contains(where: { $0.entry.dllName == entry.dllName }) {
managed.append(ManagedOverride(
entry: entry,
source: source,
label: String(localized: "config.dllOverrides.source.launcher")
))
}

return managed
Expand Down
10 changes: 9 additions & 1 deletion Whisky/Views/Bottle/GraphicsConfigSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct GraphicsConfigSection: View {
HStack {
Image(systemName: "info.circle")
.foregroundStyle(.blue)
Text("config.graphics.backend.launcherReset")
Text(launcherBackendResetMessage)
.font(.caption)
Spacer()
Button {
Expand Down Expand Up @@ -352,6 +352,14 @@ extension GraphicsConfigSection {
.filter { seen.insert($0).inserted }
}

/// What the notice says, by the launcher whose profile had switched the
/// bottle to DXVK: Steam's, or Rockstar's in a bottle without Steam (#408).
var launcherBackendResetMessage: LocalizedStringKey {
bottle.settings.detectedLauncher == .rockstar
? "config.graphics.backend.launcherReset.rockstar"
: "config.graphics.backend.launcherReset"
}

/// Recommended would run these on DXVK; an explicit D3DMetal or DXMT does not.
@ViewBuilder
var chromiumOnExplicitBackendNotice: some View {
Expand Down
14 changes: 8 additions & 6 deletions Whisky/Views/Bottle/LauncherConfigSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@ extension LauncherConfigSection {

Divider()

// Rockstar is the only launcher that requires DXVK; every launcher
// already resolves to DXVK under the Recommended backend
// Rockstar is the only launcher that requires DXVK, and only without the
// GPTK payload (#408); every launcher already resolves to DXVK under the
// Recommended backend
Toggle("Use DXVK for Rockstar Games Launcher", isOn: $bottle.settings.autoEnableDXVK)
.help("""
Rockstar Games Launcher shows no window without DXVK. When it is this bottle's \
launcher, the bottle switches to DXVK on detection and every program in it runs \
with DXVK, whatever Graphics Backend is set to. Other launchers already run on DXVK \
under the Recommended backend.
Without the Game Porting Toolkit, a bottle whose launcher is the Rockstar Games \
Launcher switches to DXVK on detection, and every program in it except the launcher \
itself runs with DXVK, whatever Graphics Backend is set to. The launcher draws with \
Wine's own Direct3D either way, and with the Game Porting Toolkit installed this \
setting does nothing. Other launchers already run on DXVK under the Recommended backend.
""")

Divider()
Expand Down
27 changes: 22 additions & 5 deletions WhiskyKit/Sources/WhiskyKit/Whisky/BottleSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -670,16 +670,33 @@ public struct BottleSettings: Codable, Equatable {
/// the standalone launcher's processes no launch writes an entry for.
/// `Launcher.exe` itself draws on Wine's own Direct3D through its own
/// entry (#382), and a bottle with Steam never gets the Rockstar profile,
/// so its games stay off this. When on, detecting it
/// switches the bottle to DXVK, and every launch in the bottle deploys
/// DXVK and (in launcher compatibility mode) gets its DLL overrides,
/// whatever ``graphicsBackend`` says.
/// so its games stay off this. When on and the GPTK payload is not
/// deployed, detecting it switches the bottle to DXVK, and every launch in
/// the bottle deploys DXVK and (in launcher compatibility mode) gets its
/// DLL overrides, whatever ``graphicsBackend`` says. With the payload it
/// does nothing (``launcherForcesDXVK(builtinD3D12IsD3DMetal:)``).
/// Every launcher already resolves to DXVK under `.recommended`.
public var autoEnableDXVK: Bool {
get { launcherConfig.autoEnableDXVK }
set { launcherConfig.autoEnableDXVK = newValue }
}

/// Whether the bottle's launcher puts every program in the bottle on
/// DXVK: ``autoEnableDXVK`` is on, the detected launcher requires DXVK
/// (Rockstar's), and the GPTK payload is not deployed.
///
/// With the payload, the Rockstar Games Launcher can only draw on Wine's
/// own `d3d11` in `system32`, which Whisky puts there only while the
/// bottle's own programs don't load DXVK from it (#382). Bottle-wide DXVK
/// kept the launcher from drawing at all in a bottle without Steam (#408),
/// and `Launcher.exe` and `SocialClubHelper.exe` get the Direct3D they
/// need through entries of their own either way.
///
/// - Parameter builtinD3D12IsD3DMetal: Whether the GPTK payload is deployed.
public func launcherForcesDXVK(builtinD3D12IsD3DMetal: Bool) -> Bool {
Comment thread
graphify-labs[bot] marked this conversation as resolved.
Resolved
autoEnableDXVK && detectedLauncher?.requiresDXVK == true && !builtinD3D12IsD3DMetal
}

/// Whether the Rockstar Games Launcher may draw on Wine's own Direct3D
/// while GPTK is deployed: Wine's `d3d11` in `system32`, with DXVK copies
/// beside Steam's and Social Club's Chromium (#382). On by default.
Expand Down Expand Up @@ -1134,7 +1151,7 @@ public struct BottleSettings: Codable, Equatable {
}

// Auto-enable DXVK DLL overrides if launcher requires it
if autoEnableDXVK, launcher.requiresDXVK {
if launcherForcesDXVK(builtinD3D12IsD3DMetal: builtinD3D12IsD3DMetal) {
for entry in DLLOverrideResolver.dxvkPreset(builtinD3D12IsD3DMetal: builtinD3D12IsD3DMetal) {
launcherDLLOverrides.append((entry: entry, source: .launcher(launcher.displayName)))
}
Expand Down
42 changes: 35 additions & 7 deletions WhiskyKit/Sources/WhiskyKit/Wine/LauncherBackendMigration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import Foundation
import os.log

/// Puts a bottle that a Steam profile switched to DXVK back on Recommended,
/// once D3DMetal is there to serve its games.
/// Puts a bottle that a Steam or Rockstar profile switched to DXVK back on
/// Recommended, once D3DMetal is there to serve its games.
///
/// Up to 3.7.0, the Steam profile Play applies set the whole bottle to DXVK so
/// the client could draw. That turned `d3d12` off for every game Steam
Expand Down Expand Up @@ -48,6 +48,15 @@ import os.log
/// switch. Such a bottle, in launcher mode auto with Rockstar detected and
/// Steam installed, gets Steam back as its launcher, and its DXVK is marked
/// as the profile's, once.
/// - A bottle without Steam that the Rockstar profile switched. With
/// Auto-enable DXVK on, detecting Rockstar's launcher put the whole bottle
/// on DXVK, and with the GPTK payload that keeps the launcher itself from
/// drawing: Whisky only gives it Wine's own `d3d11` while the bottle's
/// programs don't all load DXVK (#408). The profile now leaves such a
/// bottle alone over D3DMetal and marks a switch it still makes without the
/// payload. A bottle an older version switched, in launcher mode auto with
/// Rockstar detected, DXVK as the backend and Auto-enable DXVK on, has its
/// DXVK marked as the profile's, once.
///
/// A qualifying bottle goes back to Recommended as soon as D3DMetal is
/// installed: on load, or right after the payload is imported or deployed. A
Expand All @@ -60,15 +69,19 @@ public enum LauncherBackendMigration {
/// Rockstar profile took over.
///
/// Each step runs only on bottles stamped below its own version, so a
/// bottle stamped 2 never has its DXVK guessed at again.
public static let current = 3
/// bottle stamped 2 never has its DXVK guessed at again. 4 marks the
/// bottles an older Rockstar profile switched.
public static let current = 4

/// The version that marks bottles an older Steam profile switched.
static let steamProfileVersion = 2

/// The version that gives Steam back the bottles the Rockstar profile took over.
static let rockstarRepairVersion = 3

/// The version that marks bottles without Steam an older Rockstar profile switched.
static let rockstarProfileVersion = 4

/// Runs the migration on `bottle`: runs the steps it has not been through
/// and stamps it, then puts it back on Recommended if it qualifies and
/// D3DMetal is installed.
Expand Down Expand Up @@ -100,6 +113,9 @@ public enum LauncherBackendMigration {
"Gave '\(settings.name, privacy: .public)' back to Steam from the Rockstar profile"
)
}
if stamp < rockstarProfileVersion, wasSwitchedByRockstarProfile(settings) {
settings.launcherSwitchedBackend = true
}
settings.launcherBackendMigration = current
changed = true
}
Expand All @@ -108,7 +124,7 @@ public enum LauncherBackendMigration {
if reset {
restore(&settings)
Logger.wineKit.info(
"Put '\(settings.name, privacy: .public)' back on Recommended; Steam keeps DXVK per executable"
"Put '\(settings.name, privacy: .public)' back on Recommended; its launcher keeps DXVK per executable"
)
changed = true
}
Expand All @@ -119,11 +135,12 @@ public enum LauncherBackendMigration {
return reset
}

/// Whether the settings are on DXVK only because a Steam profile put them there.
/// Whether the settings are on DXVK only because a Steam or Rockstar
/// profile put them there.
static func isRestorable(_ settings: BottleSettings) -> Bool {
settings.launcherSwitchedBackend
&& settings.graphicsBackend == .dxvk
&& settings.detectedLauncher == .steam
&& (settings.detectedLauncher == .steam || settings.detectedLauncher == .rockstar)
}

/// Puts the settings back on Recommended and raises the notice that says so.
Expand All @@ -140,6 +157,17 @@ public enum LauncherBackendMigration {
&& settings.graphicsBackend == .dxvk
}

/// Whether the settings look like the result of an older Rockstar profile
/// in a bottle without Steam: launcher mode auto, Rockstar detected, DXVK
/// as the backend, Auto-enable DXVK on. Run after Steam bottles the
/// profile took over got Steam back, so those no longer match.
static func wasSwitchedByRockstarProfile(_ settings: BottleSettings) -> Bool {
settings.launcherMode == .auto
&& settings.detectedLauncher == .rockstar
&& settings.graphicsBackend == .dxvk
&& settings.autoEnableDXVK
}

/// Whether the bottle is a Steam bottle the Rockstar profile took over:
/// launcher mode auto, Rockstar detected, and Steam installed. A bottle
/// with only Rockstar's launcher keeps Rockstar's profile.
Expand Down
Loading
Loading