Skip to content

video_core: Fix shader cache folder creation for MKW - #812

Open
failaip12 wants to merge 2 commits into
Eglantine-Community:nx2from
cira0100:video_core/mkw-pipeline-cache-dir
Open

failaip12 wants to merge 2 commits into
Eglantine-Community:nx2from
cira0100:video_core/mkw-pipeline-cache-dir

Conversation

@failaip12

@failaip12 failaip12 commented Nov 9, 2026 •

Copy link
Copy Markdown

Summary

While testing some shader precompilation ideas i noticed that the game ran much worse than normal even with restarts. Turns out new installs don't create the vulkan shader cache folder for MKW, also using the "Remove All Shader Caches" option also triggers this bug. This PR fixes it.

Regressed in #737

Type of change

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

Related issues

None yet.

Testing

  • Tested on Windows
  • Tested on Linux
  • Tested on macOS
  • Tested on NVIDIA
  • Tested on AMD
  • Tested on Intel

Games tested:

Mario Kart World 1.8.0, tested a full race with restart. Shaders survived.

Checklist

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

Assisted-by: Opus 5.5 (investigation, regression test and fix).

pattex67 pushed a commit to pattex67/Aubepine that referenced this pull request Nov 9, 2026
…glantine-Community#812)

The builder only read *.bfsha.zs and *.sarc.zs archives (plus effect
bundles), so loose .bnsh, uncompressed .bfsha, .cgsb, .shn and .sharcb
files never reached WalkArchive, which reads all of them. Discovery now
accepts each of those extensions, raw or .zs, in ClassifyGameFile, which
the new unit test covers.
@failaip12 failaip12 mentioned this pull request Nov 9, 2026
12 of 21 tasks
@failaip12
failaip12 force-pushed the video_core/mkw-pipeline-cache-dir branch from 5a23e81 to 56414b3 Compare November 10, 2026 00:10
Mario Kart World keeps its pipeline cache in <shader>/<title id>/mkw_zero_depth_v1.
CreateDir is not recursive, so on a fresh cache the title directory did not exist,
LoadDiskResources logged "Failed to create pipeline cache directories" and returned,
and vulkan.bin was never written. Use CreateDirs for the whole path.

CreateDirs already logs the path and the error on failure. Replace the old log
line with one that says the pipeline cache is disabled for the session, since
that cost is what went unnoticed.

Assisted-by: Claude Opus 5.5 (investigation and implementation)
Signed-off-by: failaip12 <86018517+failaip12@users.noreply.github.com>
Move the per-title cache directory setup out of LoadDiskResources into
CreatePipelineCacheDir in pipeline_cache_dir.h/.cpp, so it can be tested
without a Vulkan device or all of vk_pipeline_cache.h. It takes the shader
directory as a parameter, so the tests do not change the global ShaderDir.
The tests check that a plain title gets <shader>/<title id>, that Mario Kart
World gets <shader>/0400c3f00006e000/mkw_zero_depth_v1, and that an empty path
is returned when a file is in the way. Use Settings::MarioKartWorldProgramId
instead of the raw title id.

Assisted-by: Claude Opus 5.5 (investigation and implementation)
Signed-off-by: failaip12 <86018517+failaip12@users.noreply.github.com>
@failaip12
failaip12 force-pushed the video_core/mkw-pipeline-cache-dir branch from 56414b3 to 7e6aa11 Compare November 10, 2026 00:34
@failaip12 failaip12 changed the title video_core: Fix shader cache folder creation for MKW. video_core: Fix shader cache folder creation for MKW Nov 10, 2026
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.

1 participant