ValveSoftware / Source-1-Games

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

[TF2] DXVK complete rendering breakdown under -dxlevel #5945

Open RileyKun opened 5 months ago

RileyKun commented 5 months ago

As of the latest update that brought on 64-bit, running the game under -vulkan with a dxlevel set above 90 will cause a complete breakdown in rendering.

I should denote that the issue happens under both the 32-bit and 64-bit versions of the latest binaries. A video demonstrating the bug in action

20240428151817_2

dandongus commented 5 months ago

Can you confirm that this issue is truly caused by using a dxlevel above 90?

I can reproduce this on Windows, but only with a dxlevel set below 90. On 90 or above, the bug does not manifest. You can check what your dxlevel is set to by looking under HKCU\SOFTWARE\Valve\Source\tf\Settings in the Windows registry.

The -dxlevel launch option seems irrelevant to this bug, in fact the -dxlevel launch option appears to be completely ignored when the -vulkan launch option is present. In DXVK mode, the game appears to go off the saved dxlevel in the registry/videoconfig only.

It may be helpful to state which OS and which GPU you're using.

RileyKun commented 5 months ago

I was running -dxlevel 110 during this.

Can -dxlevel even be set on Linux? Pretty sure it's a Windows only parameter...

dandongus commented 5 months ago

dxlevel can be set on linux but it's clamped between 90 and 92 and doesn't do much.

To get back on topic: the -dxlevel launch option is ignored when the -vulkan launch option is present, so it doesn't much matter what value you're using for the launch option. In fact, you can go ahead and remove the -dxlevel launch option from your command line entirely, and as long as you make no other changes, you should still experience this bug.

Please confirm that DXLevel_V1 (found in the registry under HKCU\SOFTWARE\Valve\Source\tf\Settings) is truly set to 90 or above. I suspect you will find that you have it set to 80 or 81. If not, two distinct bugs are present here and I will open another issue.

sylveonsylvia commented 5 months ago

this bug should only happen if dxlevel is set to 80, are you sure its at 90+?

HurricanePootis commented 5 months ago

Also, as far as I am aware, dxvk does not support directx 8.

dandongus commented 5 months ago

Also, as far as I am aware, dxvk does not support directx 8.

This shouldn't be a concern: when DXVK is used, apparently, DxSupportLevel is forced to 100. Clearly, at least some setting doesn't get properly updated when switching from 80/81 to 100. This is a fixable bug.

Unless we get confirmation from OP that there's indeed some dxlevel 90+ component to this, It also happens to be the same bug as #5938, just observed after bypassing the black loading screen and main menu by loading into a map, and doing so with relatively high lighting settings (everything is very dark on low lighting settings and easily confused for a continued black screen).

VortexParadox commented 5 months ago

I get this very same rendering issue with some variants I've noticed: The game renders the main menu with no issue, it's only until a couple of seconds of being inside a map that the game will glitch and visually freeze, yet the game remains active as you can hear the world and interactions. If fullscreen optimizations are disabled, instead I get a black screen. If video resolution is changed with mat_setvideomode the game freezes up a little (likely a material system reload) and afterwards returns to render the game normally.

This is odd because all the reports mention DXVK as having involvement, but the machine that is showing these issues has no Vulkan support. I have always rendered the game with DX9 if it must be known.

dandongus commented 5 months ago

@VortexParadox Sounds like you're having a different issue, there isn't really a single commonality between this bug and the things you listed. Perhaps you could provide a video showing the graphical glitch. Also, which gpu are you using? It must be fairly old if there are no drivers available for it with vulkan support.

cl0ck-byte commented 5 months ago

oh yeah anyways, -dxlevel shouldn't be used as it resets video configuration and causes issues with alt-tabbing, try out +mat_dxlevel instead, although as others said, you can't force dxlevel while running DXVK so you have to do it beforehand

This shouldn't be a concern: when DXVK is used, apparently, DxSupportLevel is forced to 100.

if that was the case then #5938 wouldn't exist, yet it doesn't override old dxlevel before/on launch

VortexParadox commented 5 months ago

@dandongus well, aside from the same graphical glitch where it looks like the vertex matrices have the wrong transforms, the cause could be for different reasons. I just wasn't too sure if it warranted a new issue when the symptoms looked alike The laptop where this was showing up is quite old indeed, from 2015 with an Intel HD 4600 iGPU. I'd show a video but I don't believe it'd present any helpful information because as I said, once it happens the frame is frozen.

cl0ck-byte commented 5 months ago

I was running -dxlevel 110 during this.

forgot to mention this one - dxlevel 100 or anything above it does nothing as it's SFM specific according to VDC Wiki while dxlevel 95 is the highest you can go