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

(cheevos) [switch] fix crash on first load of game with achievements #16008

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

Jamiras
Copy link
Contributor

@Jamiras Jamiras commented Dec 13, 2023

Description

Fixes an issue where loading a game with achievements on the Switch version of RetroArch would crash if the game hadn't previously been loaded.

It turns out the problem isn't specific to the Switch, it's related to having Threaded Video on. If an achievement badge is not available when the popup is first queued, the rendering code will will attempt to load it again a few frames later. Since the rendering code runs on the video thread, the logic to better report an attempt to load images on a background thread (see #13247) throws an assertion exception and causes the application to terminate.

The Threaded Video code already marshals the image loading to the video thread, so I've updated the logic for detecting the loading of images on background threads to not run when Threaded Video is enabled. Additionally, I've updated the marshalling logic to not try to marshal if an image load does occur on the video thread.

Related Issues

https://discord.com/channels/184109094070779904/469974542299955210/1176267096041201704
https://discord.com/channels/310192285306454017/1182431038211899523/1182431038211899523

Related Pull Requests

n/a

Reviewers

[If possible @mention all the people that should review your pull request]

@LibretroAdmin LibretroAdmin merged commit 4bf0816 into libretro:master Dec 13, 2023
23 checks passed
@Jamiras Jamiras deleted the threaded_video_assert branch December 13, 2023 13:36
Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants