Skip to content

docs(usage): document the shader cache directory and its environment variables - #5525

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
ahmedmakroum:docs/usage-shader-cache
Oct 14, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
ahmedmakroum:docs/usage-shader-cache

Conversation

@ahmedmakroum

@ahmedmakroum ahmedmakroum commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Documents the shader cache in docs/user/USAGE.md under Runtime layout: its default shader_cache/ directory, ANYPS5_SHADER_CACHE_DIR, ANYPS5_NO_SHADER_CACHE, the per-version shader subdirectories and their cleanup, the vk-pipelines-*.bin files, and that deleting the directory is safe.

Each statement was checked against the source:

  • Default directory beside the executable, ANYPS5_SHADER_CACHE_DIR, and ANYPS5_NO_SHADER_CACHE (any non-empty value other than 0) turning off both caches: ShaderCacheDirectory in core/shader/recompiler/ShaderDiskCache.cpp, used by DiskStore there and by core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp.
  • Shader subdirectory named after the source version, and removal of other versions' subdirectories unused for 14 days: DiskStore and DiskStore::housekeeping in core/shader/recompiler/ShaderDiskCache.cpp. The store, and so the cleanup, starts at the first shader lookup (findOrCompileVariant in core/shader/recompiler/Recompiler.cpp).
  • One vk-pipelines-*.bin file per GPU and driver version (vendor ID, device ID, driver version and pipeline cache UUID in the name): core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp.
  • Rebuilt after deletion: DiskStore::housekeeping creates the directory, and WriteFileAtomically in core/shader/recompiler/ShaderCacheDirectory.hpp creates missing parent directories.

Tested

Documentation only. python3 tools/check_conventions.py passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes, written with Claude Code and reviewed by me

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation matches the current cache implementation: both cache controls, the source-version shader subdirectory and 14-day stale-version cleanup, and GPU/driver-specific Vulkan cache files are represented clearly. I verified the statements against the cited source paths in the PR body. The docs checks pass; full build jobs are skipped, as expected for this documentation-only change.

@github-actions github-actions Bot added the docs label Oct 13, 2026
@ahmedmakroum
ahmedmakroum force-pushed the docs/usage-shader-cache branch from bc640f7 to bc80f85 Compare October 13, 2026 22:56
@ahmedmakroum
ahmedmakroum requested a review from MarcZX10 October 13, 2026 23:00

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked the requested head ; it is unchanged from the head I reviewed earlier. The cache paths, versioned subdirectory and stale-version cleanup description still match the implementation. Documentation checks pass; full build jobs are skipped for this docs-only change. AI-assisted: yes; reviewed by MarcZX100.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked each statement against main (ShaderCacheDirectory, DiskStore::housekeeping, the vk-pipelines-*.bin naming in PipelineCache.cpp); they match. Conventions green; merging.

@adriadam10
adriadam10 merged commit b72378b into boykopovar:main Oct 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants