Skip to content

Commit 647de32

Browse files
Remove MMCE one-at-a-time blocking throttle; allow COV/BG/SCR to pre-queue together
The `cacheHasActiveInteractiveModeLocked` + `cacheHasQueuedInteractiveModeLocked` guard in cacheGetTextureInternal prevented BG and SCR art from queuing until the active MMCE request (typically COV) fully finished loading. This added a dead render-frame gap between each art type and meant a slow or missing COV file held up all subsequent art. The art thread already processes requests one-at-a-time (FIFO) so the serial constraint existed only in the queue submission, not execution. With the 1-frame COV head-start delay still in place, COV queues on frame 8 and BG/SCR on frame 9; the art thread then loads them in that order without any extra render-frame waits. On navigation cacheAdvanceGeneration() drops all queued requests and signals abort on the active one — generation tracking discards stale completions correctly. The game-change drop (drop queued request for a different game) is kept as a safety net with an explanatory comment. Co-authored-by: NathanNeurotic <109461996+NathanNeurotic@users.noreply.github.com>
1 parent ad76b51 commit 647de32

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/texcache.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,18 +1417,13 @@ static GSTEXTURE *cacheGetTextureInternal(image_cache_t *cache, item_list_t *lis
14171417
}
14181418

14191419
if (priority == CACHE_REQ_PRIORITY_INTERACTIVE && list != NULL && list->mode == MMCE_MODE && effectiveMode == MMCE_MODE) {
1420+
/* Safety net: if a queued request for a different game somehow survived a
1421+
* generation advance, drop it now so the new game's art can queue cleanly.
1422+
* cacheAdvanceGeneration() normally handles this on every navigation event. */
14201423
load_image_request_t *queuedMmceReq = cacheFindQueuedInteractiveModeLocked(MMCE_MODE);
14211424

14221425
if (queuedMmceReq != NULL && strcmp(queuedMmceReq->value, value) != 0)
14231426
cacheDropQueuedRequestLocked(queuedMmceReq);
1424-
1425-
/* cacheHasActiveInteractiveModeLocked() checks gArtCurrentReq != NULL, so
1426-
* dereferencing abortRequested is safe here while the cache lock is held. */
1427-
if ((cacheHasActiveInteractiveModeLocked(MMCE_MODE) && !gArtCurrentReq->abortRequested) ||
1428-
cacheHasQueuedInteractiveModeLocked(MMCE_MODE)) {
1429-
cacheUnlock();
1430-
return NULL;
1431-
}
14321427
}
14331428

14341429
if (priority == CACHE_REQ_PRIORITY_PREFETCH && cache->queuedPrefetchRequests >= cacheGetPrefetchLimit(cache)) {

0 commit comments

Comments
 (0)