@ryao I haven't had a chance to test this, but apparently it's already been solved upstream. See https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/wined3d/directx.c#l650
To test this, set your prefix's Windows version to winxp. You can do this in Proton by using the PROTON_DUMP_DEBUG_COMMANDS option to dump the debug scripts, then run winecfg with /tmp/proton_$USER/run winecfg.
If it does help, we can set that as an app default for this game.
@aeikum That worked. :)
PROTON_DUMP_DEBUG_COMMANDSx1 2019-09
Compatibility Report
System Information
I confirm:
steam-3960.log
Symptoms
Systems that report more than 2066MB of texture memory trigger a bug in the game that causes it to crash. This happens on Windows. If you use Intel integrated graphics, you are fine. If you boot with your system set to 2048MB of RAM, you are fine. The PC Gaming Wiki says to use a "Blurry Texture Fix" designed for Railroad Tycoon 3 that has the side effect of making
IDirect3DDevice8::GetAvailableTextureMem()return 512MB. This fixes things on Windows and presumably, also on Linux.https://pcgamingwiki.com/wiki/Shattered_Union#Issues_fixed
http://hawkdawg.com/txt/rt3/RT3-texture_fix_README.txt
https://steamcommunity.com/app/3960/discussions/0/530645961937729857/
Rather than downloading their binary, I added a compatibility profile for the game to the registry via
protontricks -c 'wine cmd /C reg add "HKEY_CURRENT_USER\Software\Wine\AppDefaults\ShatteredUnion.exe\Direct3D" /v "VideoMemorySize" /t REG_SZ /d "2066"' 3960, which made it work. I determined the 2066 value was the upper limit after doing a binary search.Reproduction
Proposed solution
We should modify Wine to implement a
MaxVideoMemorySizethat we can then set to 2066 inHKEY_CURRENT_USER\Software\Wine\AppDefaults\ShatteredUnion.exe\Direct3D. The current workaround works on systems that are broken by the bug in the original software. However, reporting more texture memory than is actually available on systems with less texture memory seems like a way of introducing a regression. AMaxVideoMemorySizequirk to enforce the minimum of the current texture memory and theMaxVideoMemorySizesetting would be ideal.Alternatively, we could just force it to 512MB (which is known to work for this game) and hope that nothing ever goes wrong should hardware with less texture memory be used with this game. Given that drivers should fallback on system memory for overcommit, that could be fine.
@aeikum What would you like to do here?