From 21ff9391569e48a0b5408a67c8dba3fc91899cf9 Mon Sep 17 00:00:00 2001 From: aarushkha Date: Tue, 20 Oct 2026 21:53:16 +0530 Subject: [PATCH 1/2] fix(agc): read the pipeline cache header through the long-path form on Windows PipelineCache::readHeader opened the cache file with a plain path while readFile and the writer already use NativeCachePath_nid_no_patch. Past MAX_PATH the header read failed, so every save saw the file as changed and merged it again (#7452). Co-Authored-By: Claude Opus 5.5 --- .../prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp index 4b09eaf04105..1907db69eef6 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp @@ -141,7 +141,14 @@ PipelineCache::File PipelineCache::readFile() const { } std::optional PipelineCache::readHeader() const { +#ifdef _WIN32 + std::error_code error; + const auto native = ShaderRecompiler::NativeCachePath_nid_no_patch(path, error); + if (error) return std::nullopt; + std::ifstream file(native, std::ios::binary); +#else std::ifstream file(path, std::ios::binary); +#endif FileHeader header{}; if (!file.read(reinterpret_cast(&header), sizeof(header))) return std::nullopt; return header; From 261fe36987d68f9aa28e51516c06478424197556 Mon Sep 17 00:00:00 2001 From: aarushkha Date: Tue, 20 Oct 2026 22:00:08 +0530 Subject: [PATCH 2/2] fix(agc): check a pipeline cache file's existence through the long-path form When the full read fails, readFile asked std::filesystem::exists with the plain path, so on Windows a cache file past MAX_PATH was reported missing instead of unreadable and could be saved over. Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp index 1907db69eef6..73fac4402d2c 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp @@ -96,7 +96,12 @@ PipelineCache::File PipelineCache::readFile() const { File file; if (!ShaderRecompiler::ReadWholeFile(path, file.contents)) { std::error_code error; +#ifdef _WIN32 + const auto native = ShaderRecompiler::NativeCachePath_nid_no_patch(path, error); + const bool exists = !error && std::filesystem::exists(native, error); +#else const bool exists = std::filesystem::exists(path, error); +#endif file.state = exists || error ? FileState::Unreadable : FileState::Missing; return file; }