Commit Graph
3 Commits
Author SHA1 Message Date
atdunbg 394bfd3d0c refactor: 实体句柄表皮——实体自己管理组件的 API 形态
- 新增 EntityHandle:e.AddComponent<T>() / e.GetComponent<T>() /
  e.Destroy() / e.GetUUID(),转发 entt registry,零存储开销
- Scene::CreateEntity 返回 EntityHandle;Scene 层组件接口保留
  (给渲染器/系统批量遍历用)
- 语义分层:应用层"实体管组件"(句柄表皮),
  数据层组件存储仍集中在 registry(ECS 性能根基)
2026-09-22 13:59:18 +08:00
atdunbg b73e197783 refactor: ECS 迁移到 entt,移除自研 Registry
- Entity = entt::entity(内部自带版本号),Registry = entt::registry
- Scene 对外接口不变(AddComponent/GetComponent/Each/延迟销毁/UUID),
  Renderer 与 App 层零改动完成迁移
- Each 转发 entt view(自动最小池遍历),延迟销毁队列保留
- 删除自研 Registry.h/Entity.h
2026-09-22 13:51:48 +08:00
atdunbg 8afdd9b245 feat: 引入 RenderGraph、Application 框架、ECS 与资产句柄系统
架构分层(自上而下):
  App(SandboxApp) → Application(生命周期+事件) → Scene(ECS) / AssetManager(句柄) → Renderer → RenderGraph → Vulkan 模块

- RenderGraph:声明式帧图。虚拟资源+生成号句柄、死 pass 剔除、
  拓扑排序、资源生命周期、barrier 编译期预算(Synchronization2)、
  物理镜像池按帧槽位隔离(帧间竞争从根上消除)
- 帧同步修复:per-frame-slot 命令缓冲与 UBO ring(原先单份存在
  数据竞争);统一 kMaxFramesInFlight / FrameContext
- Application:生命周期钩子(OnInit/OnUpdate/OnRender/OnShutdown)
  + 事件系统(GLFW 回调 → POD 事件 → 类型化钩子);main 只 new 派生类
- ECS:自研稀疏集 Registry(Entity=(index,generation) 防悬空,
  O(1) 增删查,Each 取最小池遍历);Scene 延迟销毁队列;
  IdComponent{UUID} 稳定外部身份
- Assets:AssetManager + AssetHandle。组件存句柄不存裸指针/Ref
  (单一所有者 + 多使用者),Renderer 删除 LoadModel 改为纯消费
- 修复退出析构:成员析构前 GPU waitIdle(资产层先于 Renderer
  析构导致 VUID-00922 资源销毁时仍在使用)
- 引入 entt 子模块备用

validation 全程零错误零警告(RTX 5060 实测)
2026-09-22 13:46:05 +08:00