Repository navigation
Conversation
Black Ops 4 keeps binding SRVs after releasing them. This is harmless while the memory is intact, because the dead refcount marker stops the view from being freed twice. Once the allocation is reused for another object, the AddRef in *GetShaderResources calls into that object's vtable and the game crashes on match exit. Add a d3d11.srvQuarantine option that keeps the last 4096 destroyed SRVs allocated before freeing them, and enable it for BlackOps4.exe. Views that are still bound when they leave the ring are leaked instead of freed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Black Ops 4 keeps binding SRVs after it has released them, and crashes when exiting a match to the lobby.
This is mostly harmless while the freed memory is still intact, since the view is already marked dead and its internal pointers are nulled, so a stale bind just ends up binding nothing. It breaks once that memory gets reused for something else. In the case I traced it was reused for a
DxvkBuffer, and when the game called*GetShaderResources, the AddRef on the stale binding went through the buffer's vtable and hit its deleting destructor instead. The buffer gets destroyed while it's still in use and the heap falls over shortly after.This adds a
d3d11.srvQuarantineoption that keeps the last 4096 destroyed SRVs allocated before actually freeing them, so stale binds keep hitting a dead view instead of whatever ends up in that memory. If a view is still bound when it leaves the ring, it is leaked rather than freed, so the eventual private release from the context does not write into freed memory. The option is off by default and only enabled forBlackOps4.exe.This is the same class of bug as the Sims 4 SRV issue (427e706), but nulling the members is not enough here since the memory itself gets recycled.
Tested on Proton with multiple match exits in a row. The crash was 100% reproducible before and has not happened since.
Proton issue: ValveSoftware/Proton#10230