Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

A game's own graphics mode reaches its launch

Gauthier Piarrette59c7288958d0
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index 996b827..86b9d1d 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -356,7 +356,10 @@ final class AppState {
// D3DMetal on a bottle whose engine had no licence accepted, and every launch in it
// died with "missing renderer"). A licence is asked for here, once, in context; a mode
// the engine simply lacks degrades to one it has, and the log says so.
- var renderer = renderer
+ // The game's own mode is part of what this launch asks for, so every path below carries
+ // it: the Steam restart check, the launch after a fix recipe, Epic (highball-db#195).
+ var renderer = Renderer.launchRequest(requested: renderer, gameOverride: rendererOverride(for: item),
+ nativeVulkan: gameDB.entry(for: item)?.nativeVulkan == true)
if let engine = engine(for: bottle) {
let entry = gameDB.entry(for: item)
let pinMode = item.pinID.flatMap { id in bottle.settings.pins.first { $0.id == id }?.renderer }
@@ -431,9 +434,9 @@ final class AppState {
applyRecipe(recipe.id, to: bottle, then: DoneState(
title: String(format: L("%@ installed"), recipe.title),
ctaTitle: String(format: L("Play %@"), item.title),
- cta: { [weak self] in
+ cta: { [weak self, renderer] in
guard let self, let fresh = self.bottles.first(where: { $0.name == bottleName }) else { return }
- self.launch(item, in: fresh)
+ self.launch(item, in: fresh, renderer: renderer)
}))
return
}
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swift
index c4904da..c226923 100644
--- a/Sources/HighballKit/Bottle.swift
+++ b/Sources/HighballKit/Bottle.swift
@@ -986,4 +986,14 @@ public extension Renderer {
if nativeVulkan { return requested ?? environment }
return requested ?? gameOverride ?? (environmentExplicit ? nil : row) ?? pin ?? environment
}
+
+ /// What a Play asks the launch for, before rows, pins and the environment are weighed: the
+ /// caller's mode, else the game's own override (none for a native-Vulkan title, as in
+ /// `choose`). The override has to travel with the launch as a request. Until 2026-09-30 it
+ /// only fed the licence check, so the launch fell back to the row or the environment and
+ /// restarted Steam to match that: a game set to DXMT ran on DXVK with no word said
+ /// (highball-db#195, Kingdom Hearts), ever since per-game modes existed.
+ static func launchRequest(requested: Renderer?, gameOverride: Renderer?, nativeVulkan: Bool = false) -> Renderer? {
+ requested ?? (nativeVulkan ? nil : gameOverride)
+ }
}
diff --git a/Tests/HighballKitTests/GuidedRendererTests.swift b/Tests/HighballKitTests/GuidedRendererTests.swift
index 3e218e0..3d29353 100644
--- a/Tests/HighballKitTests/GuidedRendererTests.swift
+++ b/Tests/HighballKitTests/GuidedRendererTests.swift
@@ -44,6 +44,16 @@ final class GuidedRendererTests: XCTestCase {
XCTAssertEqual(Renderer.choose(requested: nil, gameOverride: .dxvk, row: .d3dmetal, environmentExplicit: false, pin: nil, environment: .dxmt, nativeVulkan: true), .dxmt, "a native-Vulkan title ignores rows and overrides")
}
+ /// highball-db#195: Kingdom Hearts was set to DXMT for itself and ran on DXVK, because the
+ /// override only fed the licence check and never reached the launch. It must travel as the
+ /// launch's own request, so the launch and the Steam restart check both see it.
+ func testTheGamesOwnModeTravelsWithTheLaunch() {
+ XCTAssertEqual(Renderer.launchRequest(requested: nil, gameOverride: .dxmt), .dxmt, "THE BUG: the game's own mode is what the launch asks for")
+ XCTAssertEqual(Renderer.launchRequest(requested: .d3dmetal, gameOverride: .dxmt), .d3dmetal, "the caller's choice still wins")
+ XCTAssertNil(Renderer.launchRequest(requested: nil, gameOverride: nil), "no choice: the row and the environment decide later")
+ XCTAssertNil(Renderer.launchRequest(requested: nil, gameOverride: .dxmt, nativeVulkan: true), "a native-Vulkan title ignores overrides, as in choose")
+ }
+
func testNativeVulkanRowDecodesAndSpeaks() throws {
let json = #"{"id":"sims","title":"The Sims Legacy Collection","steam_appid":3314060,"status":"verified-local","renderer":"dxvk","nativeVulkan":true}"#
let entry = try JSONDecoder().decode(GameDBEntry.self, from: Data(json.utf8))