I'm aware of this problem but wrote it off as a random Proton issue since it doesn't happen on my wine-staging setup, and then stopped happening entirely at some point, didn't know it was due to SteamVR though.
IIRC recording an apitrace would bake the problem into the trace so it's already going wrong on the D3D11 side, not in the translation. I'll have to check this again though.
Edit: This is interesting:
warn: D3D11: Command list submitted multiple times,
warn: but d3d11.dcSingleUseMode is enabled
FWIW I'm only getting a black screen with a stuck DXVK hud on Proton 4.11-8 for some reason, in other words, I'm not entirely sure how to test this. Fixed by enabling DXVK's DXGI, for some reason it doesn't seem to like wine's.
Does enabling No it doesn't.d3d11.dcSingleUseMode = False in dxvk.conf fix the issue?
@aeikum so the reason why this happens is that the game uses a flipped projection matrix when it knows that the DLL got loaded. Of course this breaks not only the text orientation, but also backface culling.
That seems to be the only difference on the D3D11 side, I don't think there's much we can do in DXVK to fix this. Might be a game bug if it detects VR libraries being loaded while not actually being in VR mode.
For now I just disabled loading the openvr dll for this game. I know this isn't ideal solution, but at least it un-breaks the game in 2D mode.
@aeikum so the reason why this happens is that the game uses a flipped projection matrix when it knows that the DLL got loaded.
Can you elaborate on this a bit? In my testing, the text would be inverted even if I loaded the Linux openvr.so from a totally different library (winmm, in my test), and never loaded openvr_api.dll. How is that detectable by the game?
I don't know what exactly it reacts to, and without reverse-engineering the game it probably isn't possible to find out, but if the library is loaded, it writes a different matrix to a buffer.
OK, I've got some more ideas on how to debug this, I'll dig a little more. Is there an easy way to print the matrix/buffer that you're talking about to a log? E.g. dump parameter XYZ in function ABC.
Not really, the actual writing is done by the game itself and doesn't involve dxvk directly.
You could intercept D3D11ImmediateContext::Unmap (or deferred, not sure which it uses for this particular thing) and dump bytes 64-128 of all constant buffers with a size of 576 bytes, but there's going to be a lot of those and most of them won't contain the data we're looking for.
This happens because vrclient.so messes with MXCSR, and these applications don't like that. Once vrclient is fixed, we should be able to revert these hacks.
@doitsujin The steam client bug was fixed a while ago and should be in all steamvr versions now. If there are any remaining titles that were individually blacklisted because of this bug, could you make sure they are no-longer blacklisted? I ran across https://github.com/doitsujin/dxvk/commit/07fee4a0e538fb95d40809c3048b591cf5268f8f when looking into a reported "regression" by a user (https://github.com/ValveSoftware/Proton/issues/613#issuecomment-719943623). I'm not certain if SubnauticaVR was blacklisted for the same reason, but if so, could you revert that commit?
@aeikum Am i correct in assuming that this issue was solved? I see the option to disable openvr is dxvk is also gone.
I think so.
proton 4.11-8x2 2019-11openvr_api.dllx1 2019-11
Here's a weird one for you.
Software information
Metal Gear Solid 5: The Phantom Pain https://store.steampowered.com/app/287700/METAL_GEAR_SOLID_V_THE_PHANTOM_PAIN/
SteamVR https://store.steampowered.com/app/250820/SteamVR/
System information
Log files
Also reported at ValveSoftware/Proton#124#issuecomment-526285536, see screenshots there.
As far as I can tell, this has nothing to do with our vrclient wrapper. I hacked DXVK to call some random function in Wine which just calls
dlopen("path/to/vrclient.so")and this is sufficient to cause the problem. See attached hack diffs:mgsvtpp_dxvk_hack.txt
mgsvtpp_wine_hack.txt
Very well could be a driver problem, however we also saw it on a QA machine with an AMD RX 580 a while back. I don't know how to debug graphics issues. Can you take a look?