Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/user/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ HDR output is available on Windows only. Titles see it when the monitor showing

Recompiled shaders and the Vulkan pipeline cache are kept in a `shader_cache/` directory beside the output executable, so later runs skip recompilation. Set `ANYPS5_SHADER_CACHE_DIR` to use another directory, or set `ANYPS5_NO_SHADER_CACHE` to any non-empty value other than `0` to disable both caches. Shaders are stored in a subdirectory named after the recompiler's source version; subdirectories of other versions unused for 14 days are removed the first time a run looks up a shader. The pipeline cache is one `vk-pipelines-*.bin` file per GPU and driver version in the same subdirectory, so it goes with the shaders it was built from. Entries of the current version are never removed and the directory has no size limit, so a title that compiles many shaders can add several GB within minutes. Deleting the directory is safe: it is rebuilt on the next run.

A first run can stop at one very large compute shader while the GPU driver compiles its pipeline: no new frames are shown and the driver's compiler keeps several CPU threads busy, which can last from minutes to hours for shaders of several million SPIR-V words. With `APS5_PROFILE_DRAW=1` the log names such a compile before it starts (`[dispatch] creating a pipeline for N SPIR-V words`, printed above 100000 words) and its time when it ends (`[dispatch] created a pipeline for N SPIR-V words in N ms`). The title's committed memory can keep growing during the compile, so the system commit limit (see Runtime layout) needs room for it; on Windows, enlarge the page file before such a run. Later runs can reuse the driver's pipeline cache, and the pipeline journal rebuilds recorded pipelines on background threads, which can avoid the wait when they are first reached; neither guarantees the driver skips the compile, and a driver update or another GPU starts a separate cache.

### Pipeline journal

Besides the recompiled shaders, the shader cache directory holds `pipelines.journal`: every Vulkan graphics pipeline the pipeline store kept and every compute pipeline a run built, with the specialized shader modules they were built from. The next run of the title builds those pipelines on background threads while it loads, so a draw or dispatch the earlier run already made does not compile its pipeline when it is first reached. The journal belongs to the GPU and driver that wrote it, like the driver's pipeline cache file next to it: a run on another GPU or driver version starts it over, and the driver's own pipeline cache decides how fast each pipeline is rebuilt. Two runs sharing the directory take turns on `pipelines.journal.lock`; a run that cannot lock it records nothing. `APS5_NO_PIPELINE_JOURNAL=1` disables recording and replay; `APS5_PIPELINE_JOURNAL_THREADS` sets the replay threads (half the CPU threads by default; `0` records without replaying), `APS5_PIPELINE_JOURNAL_ENTRIES` how many pipelines are replayed (4096, the last recorded) and `APS5_PIPELINE_STORE_ENTRIES` how many graphics pipelines stay resident (by default the store grows from 1024 up to 4096 to hold the replay and the pipelines that keep coming back), and `APS5_PIPELINE_JOURNAL_MAX_MIB` (1024) the file size at which recording stops. Deleting the file loses nothing but the head start. With `APS5_PROFILE_DRAW=1` a `[pipeline-journal]` line reports what was loaded, replayed and recorded.
Expand Down
Loading