ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
624 stars 73 forks source link

Blackscreen in TF2 while launching the game with DXVK if last working configuration was on D3D8 #5938

Open cl0ck-byte opened 2 months ago

cl0ck-byte commented 2 months ago

How to reproduce:

  1. Set mat_dxlevel to anything from D3D8 (like +mat_dxlevel 81 in launch options)
  2. Quit game
  3. Launch game again - this time with -vulkan launch parameter in order to launch DXVK
  4. Because of game running with D3D8 and DXVK not supporting it, blackscreen happens

Note that D3D8 has to be set before launching game with DXVK, otherwise forcing other versions (even if it's a correct one) will not do anything as TF will just revert it back to either last working configuration (dxlevel set through launch param) or mat_dxlevel 100 (if set by ingame console, also doesn't make sense as it's for SFM only??)

There could be a check that would force lowest dxlevel that's supported for D3D9 which is mat_dxlevel 90 but might lead to some incompatibilities. At best game should refuse to run with D3D8 and DXVK with an error.

Technically crosire/d3d8to9 exists but that's another translation layer which might introduce unexpected bugs and stability isn't guaranteed, even with just d3d8to9.

The other solution would be to drop D3D8 entirely but I don't think that's feasible.

Also could apply to Linux as they can use ToGL with D3D8? I don't know which DirectX versions it supports. ToGL only supports D3D9 I believe? Or at least that's what it says in their repo.

dandongus commented 2 months ago

I can confirm this issue is happening.

Using DXVK causes the DxSupportLevel to be forced to 100 regardless of what it was previously, and this forcing works fine regardless of whether it was previously 80/81 or 90/95 (DxSupportLevel is updated successfully), however the result is a black screen in the former case.

The game loads and is responsive, but you cannot see anything.

The other solution would be to drop D3D8 entirely but I don't think that's feasible.

This issue is minor and not game breaking for anyone (anyone experiencing it may solve it by simply switching to dxlevel 90/95/100 at any point prior to running with vulkan). As such, removing dxlevel 80/81 is not an appropriate solution.

ToGL only supports D3D9 I believe?

This is correct