View Issue Details

IDProjectCategoryView StatusLast Update
0005476The Dark ModGraphicspublic24.01.2022 17:04
Reporternbohr1more Assigned Tocabalistic  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Product VersionTDM 2.09 
Summary0005476: Bindless Textures causes freezes and stutter when changing Anisotropic Filtering in a loaded Mission
DescriptionMany of Doom 3's original graphic settings required restarts to work properly but "AF" could always be changed "on the fly".
The new Bindless textures feature seems to cause temporary disruption of this and leads to small freezes and stutter if changed without restarting.

Discussion:

https://forums.thedarkmod.com/index.php?/topic/20691-beta-testing-209/&do=findComment&comment=455172
Steps To Reproduce1) Install mission "Cleaning up the Neighborhood" (will probably be the same for any "heavy mission")
2) Start the mission and navigate to the street from the sewers
3) Exit to the menu and change the AF settings from 4x to 8x
4) Return to the mission
5) Note that the menu is frozen momentarily while returning to the mission
6) Note that the game occasionally stutters or freezes when moving around

Most of the stuttering and freezing ceases once you move around the map for awhile.
TagsNo tags attached.

Relationships

child of 0005238 resolvedcabalistic Reduce CPU draw call overhead in the backend 
child of 0005891 resolvedstgatilov Remove excessive code for bindless texture support 

Activities

cabalistic

cabalistic

05.01.2021 21:41

developer   ~0013384

So the stutters are indeed due to the fact that we need to recreate a bindless texture, because bindless textures are immutable and their parameters (like AF) can't be changed anymore. So what the code does is to unload / purge any image that's immutable when you change AF, and then the game will gradually reload them as it needs them, which causes the slow-downs and stutters.

I'm not sure there is a whole lot to be done here. I could change the behaviour so that it immediately recreates the affected textures, but that would mean that the game would freeze in the menu when you change the AF setting until the images are recreated. I don't know if that's better, because it could give the impression of a frozen game.

A "proper" fix would be to split texture handles into images and samplers. Then you'd only need to recreate the sampler part and not the image part (which is the expensive operation). However, that'd require more significant changes to our image handling, so I don't think this would be appropriate for inclusion in 2.09.
nbohr1more

nbohr1more

06.01.2021 01:44

developer   ~0013389

Hmm...

I am trying to wrap my head around what the best user experience could be prior to the "proper" fix.

I am tempted to consider a Rube Goldberg approach of disabling bindless textures if the player enters the graphics menu
while the mission is active.

Moving to 2.10
cabalistic

cabalistic

06.01.2021 09:45

developer   ~0013394

That doesn't work - you can't just "disable" bindless textures, it would also mean you have to recreate the textures, so that would cause the exact same issue.
nbohr1more

nbohr1more

06.01.2021 14:43

developer   ~0013409

This is probably pretty dependent on drivers and environment but in my experience the following sequence is an "improvement"

1) Start a mission
2) Exit to the Menu
3) Open the console and set r_useBindlessTextures to 0
4) Change AF to a higher or lower value
5) Resume the mission

When doing this, there is a small freeze when resuming (same as with bindless textures) but after the mission resumes
it goes from sluggish to normal speed with no cycle of freezes at every portal. It recovers much more quickly.
cabalistic

cabalistic

06.01.2021 15:31

developer   ~0013410

Again, setting r_useBindlessTextures to 0 changes absolutely nothing about the situation. Textures become immutable after a bindless handle has been requested for them. At that point, the texture parameters can no longer be altered until the texture is recreated, and setting r_useBindlessTextures back to 0 does not help, at all. The textures are still getting purged when you change the AF setting.

You did not specifically state that you turned bindless back on after changing AF. If you leave it off, perhaps your driver handles gradual uploading of non-bindless textures better, although that seems bogus. If you do turn it back on, this approach should not make any difference, and you are either experiencing a hallucination, or some weird driver shenanigans ;)
nbohr1more

nbohr1more

06.01.2021 18:54

developer   ~0013413

Yes, the former. Once I disabled bindless textures I left it off. The presumption being that a player who alters AF in-game will go back
and forth adjusting until they hit their preferred configuration. So (in concept) bindless textures would only resume once the player starts
a new mission or restarts TDM. If my experience is an outlier, then it is all for naught of course.
nbohr1more

nbohr1more

24.01.2022 15:59

developer   ~0014690

Closing.

In 2.11, bindless textures will be removed

Issue History

Date Modified Username Field Change
30.12.2020 17:44 nbohr1more New Issue
30.12.2020 17:44 nbohr1more Status new => assigned
30.12.2020 17:44 nbohr1more Assigned To => cabalistic
30.12.2020 17:46 nbohr1more Relationship added child of 0005238
05.01.2021 21:41 cabalistic Note Added: 0013384
06.01.2021 01:44 nbohr1more Note Added: 0013389
06.01.2021 01:44 nbohr1more Target Version => TDM 2.10
06.01.2021 09:45 cabalistic Note Added: 0013394
06.01.2021 14:43 nbohr1more Note Added: 0013409
06.01.2021 15:31 cabalistic Note Added: 0013410
06.01.2021 18:54 nbohr1more Note Added: 0013413
03.10.2021 17:08 nbohr1more Target Version TDM 2.10 => TDM 2.11
24.01.2022 15:59 nbohr1more Note Added: 0014690
24.01.2022 16:01 nbohr1more Status assigned => closed
24.01.2022 16:01 nbohr1more Resolution open => won't fix
24.01.2022 16:01 nbohr1more Target Version TDM 2.11 =>
24.01.2022 17:04 nbohr1more Relationship added child of 0005891