Commit 2a8d0a7
committed
MENU/XMB: Fix three icon regressions and a wallpaper ordering bug in
xmb_context_reset_internal
This fixes three related icon-display symptoms in the XMB driver —
all tracing back to the same underlying confusion between
animation-suppression state and data-resolution state, compounded by
the recent async icon-loading migration — and a fourth cosmetic
ordering bug in xmb_context_reset_internal that was discovered while
walking the reset flow for the icon fixes.
Symptom 1 — Main Menu > Load Core has no category icon.
The small rocket icon + `<` arrow to the left of the selected entry
never renders on cold navigation into the submenu.
Symptom 2 — Icon thumbnails (Boxart etc.) show the default disc icon
until navigating in/out of submenus or fullscreen-toggling. Per-entry
boxart thumbnails stay at their default stock fallback even though
the setting is enabled and artwork exists.
Symptom 3 — After the earlier two were fixed, a fullscreen toggle
while inside a QuickMenu wiped out the category icon on the left,
and only re-entering the submenu restored it. Subsequent toggles did
not help.
Symptom 4 — In xmb_context_reset_internal the dynamic wallpaper was
loaded against a stale xmb->title_name. xmb_path_dynamic_wallpaper()
reads title_name to build the wallpaper filename; the call was
sequenced BEFORE xmb_set_title() which writes title_name. On cold
boot title_name is empty (calloc), and after navigation it is
whatever the previous stack position left behind. In practice this
usually self-corrected on the next xmb_populate_entries ->
xmb_update_dynamic_wallpaper chain (which uses the correct
set_title -> update_wallpaper order), but one frame of wrong
wallpaper could render. xmb_set_title does not read anything
xmb_update_dynamic_wallpaper writes, so the swap is safe.
Root cause of symptoms 1-3 — two problems, same family:
(a) allow_horizontal_animation was used as a gate on three paths
that have nothing to do with animation. It is an
animation-suppression flag: calloc-initialized to false, set
true only by the restore halves of the multi-tab keyboard jump
(line 6150), the gesture/mouse jump (line 10000), and the
reinit_textures==false branch of xmb_context_reset_internal
(the deferred scale-factor path). None of those run on first
navigation into a submenu, so any non-animation logic guarded
by the flag never executes until the user does a tab jump.
The three misplaced gates were:
- xmb_set_title (from 0be544b "XMB: Current menu icon
refactor"): an early return in front of the entire
current-menu-icon resolution block, pure label/enum/texture
computation with no animation in it. With the gate,
xmb->current_menu_icon stayed 0 and the "Current menu icon
+ arrow" draw at line 8341 rendered nothing. This is
symptom 1.
- xmb_selection_pointer_changed and xmb_populate_dynamic_icons
(both from 24a1a4c "XMB: Icon thumbnail cleanups"): these
are the only two sites that set pending_icons =
XMB_PENDING_THUMBNAIL_ICONS, which is what xmb_render reads
to kick off per-entry icon-thumbnail loads. With the gate,
entries in a fresh playlist stayed at
GFX_THUMBNAIL_STATUS_UNKNOWN and the draw at line 5569
(status == AVAILABLE check) fell back to the stock disc
icon. This is symptom 2.
Fix: drop the three misplaced gates. The removed work is cheap
path-setting and flag-flipping. Intermediate tab-jump calls
self-cancel via gfx_thumbnail_cancel_pending_requests() in the
loop body, so there is no load storm during fast jumps. The
two legitimate animation-suppression uses (line 2600 gating
gfx_animation_push in xmb_list_switch_horizontal_list, line
9555 gating entry alpha animation) are untouched.
(b) After (a), xmb_set_title does run during context reset. But
xmb_context_reset_horizontal_list queues sidebar and content
icons via the async gfx_display_load_icon path (introduced by
the 4b3b8ed / 9b7eff2 / 5c1e31a async migration). Inside
xmb_context_reset_internal the order is:
xmb_context_reset_textures() // zeros current_menu_icon, sync
xmb_context_reset_horizontal_list() // queues async icon tasks
xmb_set_title() // runs NOW, tasks haven't landed
In the DEFERRED_RPL_ENTRY_ACTIONS case of xmb_set_title, the
code unconditionally assigned db_node->content_icon (or ->icon)
to the resolved texture. With the tasks still in flight those
handles are 0, so xmb->current_menu_icon got set to 0 and the
draw guard refused to render. Each subsequent fullscreen toggle
re-ran destroy -> reset -> queue -> set_title with the same
race window, so subsequent toggles didn't fix it either.
Out-and-back navigation worked only because the tasks had
wall-clock time to land before the next xmb_populate_entries
-> xmb_set_title. This is symptom 3.
Fix: two parts.
1. Guard the db_icon and sidebar_node->icon assignments in
xmb_set_title: only overwrite `texture` when the handle is
actually loaded. Otherwise leave `texture` at its prior
value (XMB_TEXTURE_QUICKMENU default, or a previously-set
sidebar icon). This alone prevents the blank-icon symptom
— the QuickMenu default shows instead.
2. Self-healing retry via a new uint8_t
current_menu_icon_retry countdown on xmb_handle_t.
xmb_set_title arms the counter (60 frames on fresh trigger,
prev_retry - 1 on ongoing retry) when it had to substitute
a fallback for an unresolved async icon. xmb_render polls
the counter each frame and re-invokes xmb_set_title while
it is nonzero. On successful resolution the fallback
branches don't fire and the counter stays 0. On permanent
failure (missing asset) the countdown terminates after ~1s
of cheap retries. The counter is a uint8_t packed next to
the existing system_tab_end field — no practical size
increase.
Bisect trail:
0be544b "XMB: Current menu icon refactor (#18508)" — introduced
the misplaced gate in xmb_set_title that caused symptom 1. The
feature shipped with the broken gate from day one.
24a1a4c "XMB: Icon thumbnail cleanups" — added the misplaced
gates at the two icon-thumbnail population sites that caused
symptom 2.
4b3b8ed "Use non-blocking image loading instead...",
9b7eff2 "Move xmb_context_reset_horizontal_list to async...",
5c1e31a "libretro-common/file/nbio/nbio_intf.c ..." — the async
icon-loading migration. This made horizontal-list icons load
asynchronously and exposed the latent assumption in
xmb_set_title that the sidebar/db-node icon handles would be
populated synchronously by context reset. Symptom 3 follows
from this + the feature from 0be544b.
Symptom 4 (the wallpaper ordering) has been latent since
xmb_update_dynamic_wallpaper and xmb_set_title coexisted — not
tied to a specific recent commit.1 parent f2e3f9e commit 2a8d0a7
1 file changed
Lines changed: 57 additions & 7 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
446 | 451 | | |
447 | 452 | | |
448 | 453 | | |
| |||
1855 | 1860 | | |
1856 | 1861 | | |
1857 | 1862 | | |
1858 | | - | |
1859 | 1863 | | |
1860 | 1864 | | |
1861 | 1865 | | |
| |||
2322 | 2326 | | |
2323 | 2327 | | |
2324 | 2328 | | |
2325 | | - | |
2326 | | - | |
2327 | | - | |
2328 | 2329 | | |
2329 | 2330 | | |
2330 | 2331 | | |
| |||
2337 | 2338 | | |
2338 | 2339 | | |
2339 | 2340 | | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
2340 | 2350 | | |
2341 | 2351 | | |
2342 | 2352 | | |
| |||
2489 | 2499 | | |
2490 | 2500 | | |
2491 | 2501 | | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
2492 | 2509 | | |
2493 | 2510 | | |
2494 | 2511 | | |
| |||
2498 | 2515 | | |
2499 | 2516 | | |
2500 | 2517 | | |
2501 | | - | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
2502 | 2535 | | |
2503 | 2536 | | |
2504 | 2537 | | |
| |||
2677 | 2710 | | |
2678 | 2711 | | |
2679 | 2712 | | |
2680 | | - | |
2681 | 2713 | | |
2682 | 2714 | | |
2683 | 2715 | | |
| |||
6835 | 6867 | | |
6836 | 6868 | | |
6837 | 6869 | | |
6838 | | - | |
6839 | 6870 | | |
6840 | 6871 | | |
| 6872 | + | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
| 6876 | + | |
| 6877 | + | |
| 6878 | + | |
| 6879 | + | |
| 6880 | + | |
| 6881 | + | |
6841 | 6882 | | |
6842 | 6883 | | |
6843 | 6884 | | |
| |||
6918 | 6959 | | |
6919 | 6960 | | |
6920 | 6961 | | |
| 6962 | + | |
| 6963 | + | |
| 6964 | + | |
| 6965 | + | |
| 6966 | + | |
| 6967 | + | |
| 6968 | + | |
| 6969 | + | |
| 6970 | + | |
6921 | 6971 | | |
6922 | 6972 | | |
6923 | 6973 | | |
| |||
0 commit comments