diff --git a/Bigfoot/Sources/Engine/SerializationManager/SerializationManager.cpp b/Bigfoot/Sources/Engine/SerializationManager/SerializationManager.cpp index 380441d..c1ef515 100644 --- a/Bigfoot/Sources/Engine/SerializationManager/SerializationManager.cpp +++ b/Bigfoot/Sources/Engine/SerializationManager/SerializationManager.cpp @@ -113,47 +113,7 @@ void LoadAssets(const eastl::span p_uuids) void LoadAsset(const UUID& p_uuid) { - ankerl::unordered_dense::set discovered; - const ankerl::unordered_dense::map> graph = BuildDependencyGraph( - eastl::span {&p_uuid, 1}, - discovered); - - // Assets that are part of a cyclic HardReference dependency are left out of waves and simply never loaded. - eastl::vector> waves; - eastl::vector cyclicUuids; - std::ignore = LayeredTopologicalSort(graph, discovered, waves, cyclicUuids); - BIGFOOT_LOG_ERROR_IF(!cyclicUuids.empty(), - ENGINE_LOGGER, - "Cyclic HardReference dependency detected while loading asset {}, involved UUIDs: {}", - p_uuid, - cyclicUuids); - - // Waves are loaded one after another since a wave's assets may HardReference the previous wave's; within a - // wave, every asset is independent of the others, so this is where loading could later be parallelized. - for (const eastl::vector& wave: waves) - { - for (const UUID& uuid: wave) - { - const eastl::vector flatbuffer = g_dataAccessor->GetAssetFlatbuffer(uuid); - if (flatbuffer.empty()) - { - BIGFOOT_LOG_ERROR(ENGINE_LOGGER, "Asset {} could not be found while loading, skipping it", uuid); - continue; - } - -#ifdef BIGFOOT_NOT_OPTIMIZED - flatbuffers::Verifier verifier {std::bit_cast(flatbuffer.data()), flatbuffer.size()}; - const bool assetVerified = ::Flat::Bigfoot::VerifyAssetBuffer(verifier); - CRITICAL_ASSERT(EngineAssertHandler, assetVerified, "Given asset could not be verified!"); -#endif - - const ::Flat::Bigfoot::Asset* asset = flatbuffers::GetRoot<::Flat::Bigfoot::Asset>(flatbuffer.data()); - - AssetContainerBase* container = g_activeAssetLibrary->GetAssetContainer( - flatbuffers::UnPack(*asset->header()->type_id())); - std::ignore = container->Insert(flatbuffer); - } - } + LoadAssets(eastl::span {&p_uuid, 1}); } /****************************************************************************************/