From 86ea861818b137e9fb41011dfc033fdb7b0581f0 Mon Sep 17 00:00:00 2001 From: xlulx <92148312+xlulx@users.noreply.github.com> Date: Wed, 25 Nov 2026 00:16:45 +0300 Subject: [PATCH] fix(frontend): turn on native DirectX shader compilers for Warband, Don't Starve Together and EU4 (#2998) * fix: turn on d3dx9 and D3DCompiler 42 for Mount & Blade Warband Warband compiles its postFX effects at launch through d3dx9_42. With Wine's built-in d3dcompiler_42 the launch stops on an error dialog (E5017 'Write pass assignments', then E5033 'Unknown target profile __fx_2_0__'). The native d3dx9 and D3DCompiler 42 components fix it, but nothing picked them: Steam's list for the game does not name them and the folder scan only recommends d3dx9. * fix: turn on D3DCompiler 43 for Don't Starve Together Don't Starve Together renders through its bundled ANGLE, which compiles vs_3_0/ps_3_0 shaders with d3dcompiler_43. With Wine's built-in compiler the bytecode trips DXVK's SM3 parser (`m_info.kind == OperandKind::eSrcReg` in sm3_parser.h), the render thread stops after "Renderer initialize: Okay" and the game sits on a black screen. The native D3DCompiler 43 component fixes it, but Steam's list for the game does not name it. * fix: turn on D3DCompiler 43 for Europa Universalis IV EU4 builds its map effects at launch through native d3dx9_43, which compiles them with d3dcompiler_43. Wine's built-in d3dcompiler_43 fails the terrain, border, map name and bloom shaders with E5005 ('No compatible 2 parameter declaration for GetFoWColor'), so the map draws black and province names show as white blocks. Steam's list for the game names only d3dx9; turning on the native D3DCompiler 43 component as well fixes the map. * test: keep one per-game redist test, the one that also covers Steam's d3dx9 pick The Warband and Don't Starve Together tests only restated their SCRIPTED rows; Skyrim's test already covers how SCRIPTED picks are added. --- .../com/droiddeck/launcher/frontend/SteamRedists.kt | 6 ++++++ .../launcher/frontend/WinComponentDetectorsTest.kt | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SteamRedists.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SteamRedists.kt index 17a2e8b6c8..342bfa9b37 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/SteamRedists.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SteamRedists.kt @@ -20,6 +20,12 @@ object SteamRedists { val SCRIPTED = mapOf( 72850 to listOf("xact" to "DirectX XACT audio"), 489830 to listOf("xact_x64" to "DirectX XACT audio (64-bit)"), + // Warband compiles its postFX .fx effects at launch through d3dx9_42; Wine's own d3dcompiler_42 stops with E5017/E5033 on fx_2_0. + 48700 to listOf("d3dx9" to "DirectX 9 (d3dx9)", "d3dcompiler_42" to "D3DCompiler 42"), + // DST's bundled ANGLE compiles SM3 shaders through d3dcompiler_43; DXVK's SM3 parser asserts on what Wine's own one emits. + 322330 to listOf("d3dcompiler_43" to "D3DCompiler 43"), + // EU4 builds its map effects through native d3dx9_43, which calls d3dcompiler_43; Wine's own one fails them with E5005, so the map draws black. + 236850 to listOf("d3dx9" to "DirectX 9 (d3dx9)", "d3dcompiler_43" to "D3DCompiler 43"), ) private val BLOCK = Regex("\"SharedDepots\"\\s*\\{([^}]*)\\}", RegexOption.IGNORE_CASE) private val ENTRY = Regex("\"(\\d+)\"\\s+\"\\d+\"") diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/WinComponentDetectorsTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/WinComponentDetectorsTest.kt index cdad5c09b7..d8b1ab708a 100644 --- a/app/src/test/java/com/droiddeck/launcher/frontend/WinComponentDetectorsTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/frontend/WinComponentDetectorsTest.kt @@ -54,6 +54,16 @@ class WinComponentDetectorsTest { assertEquals(emptyList(), WinCompSources.steamList(context, game, 409710, "Other", auto = true).map { it.component }) } + @Test fun eu4GetsTheNativeShaderCompilerItsMapEffectsNeed() { + val steamapps = tmp.newFolder("steamapps") + val game = File(steamapps, "common/Europa Universalis IV").apply { mkdirs() } + File(steamapps, "appmanifest_236850.acf").writeText("\"AppState\"\n{\n\t\"SharedDepots\"\n\t{\n\t\t\"228983\"\t\t\"228980\"\n\t\t\"228990\"\t\t\"228980\"\n\t}\n}\n") + val context = androidx.test.core.app.ApplicationProvider.getApplicationContext() + val found = WinCompSources.steamList(context, game, 236850, "Europa Universalis IV", auto = true) + assertEquals(listOf("vcredist2010_dll", "d3dx9", "d3dcompiler_43"), found.map { it.component }) + assertTrue(found.all { it.auto && it.origin == WinCompSources.Origin.STEAM }) + } + @Test fun theGamesInstallScriptRedistsAreInstalledAsSteamWould() { val steamapps = tmp.newFolder("steamapps") val game = File(steamapps, "common/DiRT 3 Complete Edition").apply { mkdirs() }