mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
fix crash showing achievement game placard when threaded video enabled and game image not cached (#16008)
This commit is contained in:
parent
c4faac0816
commit
4bf0816392
@ -2463,15 +2463,15 @@ static void rcheevos_client_load_game_callback(int result,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if (!task_is_on_main_thread())
|
if (!video_driver_is_threaded() && !task_is_on_main_thread())
|
||||||
{
|
{
|
||||||
/* have to "schedule" this. game image should not be loaded on background thread */
|
/* have to "schedule" this. game image should not be loaded on background thread */
|
||||||
rcheevos_locals.queued_command = CMD_CHEEVOS_NON_COMMAND;
|
rcheevos_locals.queued_command = CMD_CHEEVOS_NON_COMMAND;
|
||||||
rcheevos_locals.game_placard_requested = true;
|
rcheevos_locals.game_placard_requested = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rcheevos_show_game_placard();
|
|
||||||
#endif
|
#endif
|
||||||
|
rcheevos_show_game_placard();
|
||||||
|
|
||||||
rcheevos_finalize_game_load(client);
|
rcheevos_finalize_game_load(client);
|
||||||
|
|
||||||
|
@ -475,12 +475,15 @@ uintptr_t rcheevos_get_badge_texture(const char* badge, bool locked, bool downlo
|
|||||||
if (!badge || !badge[0])
|
if (!badge || !badge[0])
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* OpenGL driver crashes if gfx_display_reset_textures_list is called on a background thread */
|
#ifdef HAVE_THREADS
|
||||||
if (!task_is_on_main_thread())
|
/* The OpenGL driver crashes if gfx_display_reset_textures_list is not called on the video thread.
|
||||||
{
|
* If threaded video is enabled, it'll automatically dispatch the request to the video thread.
|
||||||
CHEEVOS_ERR(RCHEEVOS_TAG "attempt to load badge %s from background thread", badge);
|
* If threaded video is not enabled, just return null. The video thread should assume the image
|
||||||
retro_assert(task_is_on_main_thread());
|
* wasn't downloaded and check again in a few frames.
|
||||||
}
|
*/
|
||||||
|
if (!video_driver_is_threaded() && !task_is_on_main_thread())
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
|
snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
|
||||||
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
|
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
|
||||||
|
@ -1432,6 +1432,11 @@ unsigned video_thread_texture_load(void *data, custom_command_method_t func)
|
|||||||
if (!thr)
|
if (!thr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* if we're already on the video thread, just call the function, otherwise
|
||||||
|
* we may deadlock with ourself waiting for the packet to be processed. */
|
||||||
|
if (sthread_get_thread_id(thr->thread) == sthread_get_current_thread_id())
|
||||||
|
return func(data);
|
||||||
|
|
||||||
pkt.type = CMD_CUSTOM_COMMAND;
|
pkt.type = CMD_CUSTOM_COMMAND;
|
||||||
pkt.data.custom_command.method = func;
|
pkt.data.custom_command.method = func;
|
||||||
pkt.data.custom_command.data = data;
|
pkt.data.custom_command.data = data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user