forgot file

This commit is contained in:
Fire Cube 2025-07-15 20:38:56 +02:00
parent b1db45a64d
commit 4a3bbb3747
2 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,29 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <cereal/archives/binary.hpp>
#include <boost/container/small_vector.hpp>
#include <common/types.h>
namespace cereal {
// boost::small_vector
template<class Archive, class T, std::size_t N, class Alloc>
void save(Archive& ar, boost::container::small_vector<T, N, Alloc> const& smallVector) {
ar(make_size_tag(static_cast<u32>(smallVector.size())));
for (auto const& element : smallVector)
ar(element);
}
template<class Archive, class T, std::size_t N, class Alloc>
void load(Archive& ar, boost::container::small_vector<T, N, Alloc>& smallVector) {
u32 elementCount;
ar(make_size_tag(elementCount));
smallVector.resize(elementCount);
for (auto& element : smallVector)
ar(element);
}
}

View File

@ -281,7 +281,6 @@ bool CheckShaderCache(std::string shader_id) {
}
void GetShader(std::string shader_id, Shader::Info& info, std::vector<u32>& spv) {
// read spirv
std::filesystem::path spirv_cache_filename = shader_id + ".spv";
std::filesystem::path spirv_cache_file_path = SHADER_CACHE_DIR / spirv_cache_filename;
Common::FS::IOFile spirv_cache_file(spirv_cache_file_path, Common::FS::FileAccessMode::Read);
@ -289,7 +288,6 @@ void GetShader(std::string shader_id, Shader::Info& info, std::vector<u32>& spv)
spirv_cache_file.Read(spv);
spirv_cache_file.Close();
// read resources
std::filesystem::path resource_dump_filename = shader_id + ".resources";
std::filesystem::path resources_dump_file_path = SHADER_CACHE_DIR / resource_dump_filename;
Common::FS::IOFile resources_dump_file(resources_dump_file_path,