Skip to content

kepler_compute: clear rejected programs on shader restore - #860

Merged
kraibse merged 1 commit into
Eglantine-Community:nx2-experimentalfrom
GingerSnaps258:fix/compute-reject-restore
Nov 14, 2026
Merged

kraibse merged 1 commit into
Eglantine-Community:nx2-experimentalfrom
GingerSnaps258:fix/compute-reject-restore

Conversation

@GingerSnaps258

@GingerSnaps258 GingerSnaps258 commented Nov 13, 2026 •

Copy link
Copy Markdown
  • [X ] I have read and followed the Contribution Guidelines.
  • [ X] I have read and followed the AI Policy.
  • [X ] I have read and followed the Coding Guidelines to the best of my ability.
  • I have put [HUMANMADE] in the title if the pr was human-made

Summary

Compute shaders disabled via the debug server (reject_shaders)
remained inactive after being restored until the emulator was
restarted. In The Legend of Zelda: Ocarina of Time, this left
the 3D viewport completely black.

This happened because KeplerCompute maintains its own cache of
programs that failed to execute (rejected_compute_programs), which
was never invalidated when shaders were re-enabled.

Update the debug-control logic to track a restore counter, and
have KeplerCompute clear its rejected program list whenever that
count increments. This only affects debugging tools and not normal play.

Assisted-by: Claude Opus 5.5 (traced the rejected program cache and wrote the restore counter fix)

Type of change

  • [x ] Bug fix
  • Game compatibility / game-support
  • Performance
  • New feature
  • Refactor / cleanup
  • CI / build
  • Documentation

Related issues

None

Testing

  • [x ] Tested on Windows
  • Tested on Linux
  • Tested on macOS
  • Tested on NVIDIA
  • Tested on AMD
  • [x ] Tested on Intel

Games tested:

Ocarina of Time, gameplay in Kokiri Forest
Hardware: MSI Claw 8+ AI, Intel Arc 140V, driver 101.9175, Windows

Test: rejected the gameplay network’s main pass (da6df3e54c716df2) through the debug server, then restored it

Result: rejected → 3D view black (only hearts and minimap drawn); restored → normal again within ~2 s, no restart; nothing left rejected afterwards

Without the fix: the view stays black after restore until the emulator restarts

Checklist

  • [x ] I built it locally and it compiles without new warnings
  • [x ] I did not add any copyrighted game data, keys or firmware
  • [x ] Docs updated if needed. (not needed)
  • [x ] I added AI Disclosure if one was used

Screenshots / logs

oot-restore-test-1-before oot-restore-test-2-rejected oot-restore-test-3-restored

Summary by CodeRabbit

  • New Features
    • Added an optional local MCP server for emulator status, game control, input, screenshots, performance monitoring, debugging, and other tools.
    • Added graphics and performance options, including DLSS quality, mesh shaders, CPU-core preferences, and configurable memory hints.
    • Added recommended settings for more games and built-in patches for Ocarina of Time.
  • Improvements
    • Improved graphics compatibility, including support for systems without native mesh shaders.
    • New Android usernames are validated for length and UTF-8 encoding.

Compute shaders disabled via the debug server (reject_shaders)
remained inactive after being restored until the emulator was
restarted. In The Legend of Zelda: Ocarina of Time, this left
the 3D viewport completely black.

This happened because KeplerCompute maintains its own cache of
programs that failed to execute (rejected_compute_programs), which
was never invalidated when shaders were re-enabled.

Update the debug-control logic to track a restore counter, and
have KeplerCompute clear its rejected program list whenever that
count increments.

Tested in Ocarina of Time by rejecting and restoring compute
dispatches 119–142. Compute GPU time recovered to ~450–490 ms/s
and the 3D scene resumed rendering normally.

Assisted-by: Claude Opus 5.5 (traced the rejected program cache and wrote the restore counter fix)
@github-actions
github-actions Bot changed the base branch from nx2 to nx2-experimental November 13, 2026 22:22
@github-actions

Copy link
Copy Markdown

Retargeted to nx2-experimental for pre-build testing. It will be promoted to nx2 after validation.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 946b19dc-3776-488a-8e37-ed802dc8ce6a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@kraibse

kraibse commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks — the analysis is right and the fix is minimal. rejected_compute_programs is the third rejection cache (ShaderCache::RefreshDebugRejections clears rejected_native and dropscached programs, but nothing clears the per-address compute failure records), and it's only bypassed while Nx2Diag::Active(), which is why the viewport stayed black with diagnosticsoff. Confirmed nothing else in video_core caches compute rejection, so this closes the symptom.

@kraibse

kraibse commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Just built and tested the build to see if there are any consequences on an unaffected device. Doesn't seem to be the case. This fix is deeply necessary as people are still having black screens but can see the UI. Another affected game would be FEFW.

Confirmed and merging.

@kraibse
kraibse merged commit 0a2323e into Eglantine-Community:nx2-experimental Nov 14, 2026
2 checks passed
@GingerSnaps258
GingerSnaps258 deleted the fix/compute-reject-restore branch November 14, 2026 01:42
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