资产改为保存场景或者关闭软件时候更新guid文件,vulkan/DescriptorManager 创建DescriptorPool时候注释eFreeDescriptorSet,PhysicsWorld初始化时候改为推荐的inNumBodyMutexes
This commit is contained in:
@@ -50,6 +50,7 @@ namespace Engine::Assets {
|
||||
m_PathToGuid.emplace(path, guid);
|
||||
m_GuidToPath.emplace(guid, path);
|
||||
SaveGUIDRegistry();
|
||||
m_GuidRegistryDirty = true;
|
||||
return guid;
|
||||
}
|
||||
|
||||
@@ -61,6 +62,12 @@ namespace Engine::Assets {
|
||||
return {};
|
||||
}
|
||||
|
||||
void AssetManager::FlushGUIDRegistry() {
|
||||
if (!m_GuidRegistryDirty) return;
|
||||
SaveGUIDRegistry();
|
||||
m_GuidRegistryDirty = false;
|
||||
}
|
||||
|
||||
void AssetManager::LoadGUIDRegistry()
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -55,6 +55,13 @@ namespace Engine {
|
||||
m_Renderer->GetDevice().GetDevice().waitIdle();
|
||||
}
|
||||
|
||||
// ✅ 进程退出前持久化 GUID 注册表(GetOrCreateGUID 只标 dirty,
|
||||
// 此处统一落盘,避免开发期每次新增都触发全量 yaml 重写)
|
||||
if (m_Assets) {
|
||||
m_Assets->FlushGUIDRegistry();
|
||||
}
|
||||
|
||||
|
||||
if (m_ImGuiLayer) m_ImGuiLayer.reset();
|
||||
|
||||
// 注意:这里不能 Logger::Shutdown()——成员析构(Device 销毁等)
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Engine {
|
||||
m_ObjectVsObjectLayerFilter = CreateScope<ObjectLayerPairFilterImpl>();
|
||||
|
||||
m_System = CreateScope<JPH::PhysicsSystem>();
|
||||
m_System->Init(4096, 0, 16384, 4096,
|
||||
m_System->Init(4096, 65536, 16384, 4096,
|
||||
*m_BPLayerInterface, *m_ObjectVsBPLayerFilter,
|
||||
*m_ObjectVsObjectLayerFilter);
|
||||
m_System->SetGravity(JPH::Vec3(0.0f, -9.81f, 0.0f));
|
||||
|
||||
@@ -461,6 +461,7 @@ namespace Engine::Serialization {
|
||||
return false;
|
||||
}
|
||||
file << doc;
|
||||
assets.FlushGUIDRegistry();
|
||||
return true;
|
||||
}
|
||||
catch (const YAML::Exception& e) {
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace Engine
|
||||
|
||||
vk::DescriptorPoolCreateInfo poolInfo;
|
||||
poolInfo.setMaxSets(kChunkSets)
|
||||
.setPoolSizes(poolSizes)
|
||||
.setFlags(vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet);
|
||||
.setPoolSizes(poolSizes);
|
||||
// .setFlags(vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet);
|
||||
|
||||
return m_Device.GetDevice().createDescriptorPool(poolInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user