mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-12-01 17:50:36 +01:00
[common] rework BitField and BitUtil, use concepts whenever possible (#4076)
test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
c2e74a9380
commit
41762940d6
31 changed files with 529 additions and 757 deletions
|
|
@ -219,16 +219,13 @@ void SerializePipeline(std::span<const char> key, std::span<const GenericEnviron
|
|||
const std::filesystem::path& filename, u32 cache_version);
|
||||
|
||||
template <typename Key, typename Envs>
|
||||
void SerializePipeline(const Key& key, const Envs& envs, const std::filesystem::path& filename,
|
||||
u32 cache_version) {
|
||||
static_assert(std::is_trivially_copyable_v<Key>);
|
||||
static_assert(std::has_unique_object_representations_v<Key>);
|
||||
SerializePipeline(std::span(reinterpret_cast<const char*>(&key), sizeof(key)),
|
||||
std::span(envs.data(), envs.size()), filename, cache_version);
|
||||
requires std::is_trivially_copyable_v<Key>
|
||||
&& std::has_unique_object_representations_v<Key>
|
||||
void SerializePipeline(const Key& key, const Envs& envs, const std::filesystem::path& filename, u32 cache_version) {
|
||||
SerializePipeline(std::span(reinterpret_cast<const char*>(&key), sizeof(key)), std::span(envs.data(), envs.size()), filename, cache_version);
|
||||
}
|
||||
|
||||
void LoadPipelines(
|
||||
std::stop_token stop_loading, const std::filesystem::path& filename, u32 expected_cache_version,
|
||||
void LoadPipelines(std::stop_token stop_loading, const std::filesystem::path& filename, u32 expected_cache_version,
|
||||
Common::UniqueFunction<void, std::ifstream&, FileEnvironment> load_compute,
|
||||
Common::UniqueFunction<void, std::ifstream&, std::vector<FileEnvironment>> load_graphics);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue