Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing lock on texture cache UpdateMapping method #6657

Merged
merged 1 commit into from May 14, 2024

Conversation

gdkchan
Copy link
Member

@gdkchan gdkchan commented Apr 12, 2024

The UpdateMapping method removes and adds a new texture, so it must take a look for the textures tree, since it might be accessed by another thread (for example, on MemoryUnmappedHandler method).

This additionally refactors the lock usage to instead use a ReaderWriterLockSlim, which allows concurrent access to the tree and should be more efficient than the regular lock (which would block on concurrent access).

This fixes a crash on the game Harmony: The Fall of Reverie. Other games might be affected as well.
The crash happens upon entering this place called "the Naiads".
image
image

@gdkchan gdkchan added the fix Fix something label Apr 12, 2024
@github-actions github-actions bot added the gpu Related to Ryujinx.Graphics label Apr 12, 2024
@ryujinx-mako ryujinx-mako bot requested review from riperiperi and a team April 12, 2024 20:30
@AcK77 AcK77 merged commit cd78adf into Ryujinx:master May 14, 2024
13 checks passed
@gdkchan gdkchan deleted the fix-tex-lock branch May 15, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something gpu Related to Ryujinx.Graphics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants