[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:
lizzie 2026-07-09 03:47:04 +02:00 • committed by crueter
parent c2e74a9380
commit 41762940d6
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
31 changed files with 529 additions and 757 deletions

View file

@ -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);