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
12 changes: 12 additions & 0 deletions core/libs/prx/libSceAgcDriver/Graphics/src/PipelineCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -141,7 +146,14 @@ PipelineCache::File PipelineCache::readFile() const {
}

std::optional<PipelineCache::FileHeader> 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<char*>(&header), sizeof(header))) return std::nullopt;
return header;
Expand Down
Loading