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

Make TextureGroup.ClearModified thread safe #6686

Merged
merged 1 commit into from May 14, 2024

Conversation

gdkchan
Copy link
Member

@gdkchan gdkchan commented Apr 18, 2024

The list of views from the texture is passed directly on TextureGroup.UpdateViews. That list is accessed on the ClearModified method. However the ClearModified method can be called from other threads (due to the MemoryUnmappedHandler). For the most part, this method seems already thread safe, except for the views list that can be modified from other threads and cause crashes. To fix this, I changed the code to store an array copy of the list, instead of a reference to the list itself.

One such crashes was reported on Ryujinx/Ryujinx-Games-List#4935
Testing is welcome.

@gdkchan gdkchan closed this Apr 18, 2024
@gdkchan gdkchan reopened this Apr 18, 2024
@github-actions github-actions bot added the gpu Related to Ryujinx.Graphics label Apr 18, 2024
@ryujinx-mako ryujinx-mako bot requested review from riperiperi and a team April 18, 2024 23:38
@gdkchan gdkchan added the fix Fix something label Apr 19, 2024
@Vaskiemaia
Copy link

Vaskiemaia commented Apr 19, 2024

The PR solves the crashing problem with Europa (Demo) - Ryujinx/Ryujinx-Games-List#4935

I have now completed the demo and didn't come across a crash once.

Thank you gdkchan!

@AcK77 AcK77 merged commit 2ef4f92 into Ryujinx:master May 14, 2024
14 of 16 checks passed
@gdkchan gdkchan deleted the clear-mod-thread-safe 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

4 participants