Stage D (shadow part): each in-flight slot's FrameGraph now owns both the shadow and G-buffer passes as declarative, dependency-free passes in one layer. The CSM array is imported per cascade via its layer view with arrayLayers=3 so barriers cover the whole array; every cascade ends in DepthStencilReadOnlyOptimal for the engine-side forward pass to sample. - recordPendingShadowPasses / recordPendingGBufferPass are gone, merged into recordDeferredFrameGraph(): graph record + submit before the swapchain pass, with a once-per-slot-per-frame guard so repeated render3D() calls in one script frame never re-record the same command buffers (resetting in-flight CBs hung the driver). - buildDeferredFrameGraphs() rebuilds one graph per slot from the current shadow array + G-buffer targets; shadows can be enabled without a G-buffer pass and vice versa (graphs are built on demand). - JobSystem fix (PR #134 scheduler bug): completeJob now decrements outstanding/outstandingFrame only after fireCompletion + releaseDependents have finished using the job. Previously a waiter (beginFrame/endFrame) could observe outstandingFrame == 0 and reset the per-frame arena while a worker still touched the job (use-after-free: lost forked job -> hang, or crash). Two stress tests (render_graph.jobSystemGroupStress, render_graph.jobSystemEngineFramePattern) cover the engine's exact beginFrame/parallel_for/task-group frame pattern. - Recording stays serial (graph->record()) for now: the JobSystem help-execution path still has a residual timing-sensitive race that can leave a worker stuck in a pass callback. The parallel executor (jobSystemPassExecutor) is ready and CPU-tested; enable it once that race is root-caused upstream (documented in FrameGraphJobs.h). Verified locally (win32-debug, full clean rebuild): render_graph.*, thread.*, Shadow3D.*, RenderSystem3D.*, Lighting3D.*, Mesh.* and AO/AA/Outline/GI — 77 cases pass.
EVEngine 开发者文档
本目录保存引擎的架构、模块设计、测试策略和实现计划,面向 EVEngine 本身的维护者与贡献者。
架构与工程约定
- 发布流程(
main/dev/vX.X.X,Pre-release 发版) - 整体架构
- 模块设计与实现进度
- 模块编排与裁剪架构(实测依赖分层、协作接缝、按需裁剪;用户侧用法见按需裁剪模块)
- 依赖项
- 命令行设计
- 测试覆盖
- AI 与 MCP 支持
- AI 场景导演(剧情 → 自动搭台 → 质检迭代 → 交付)
- 游戏开发系统与工具差距分析
功能设计
- 2D 渲染 API
- 3D 渲染管线(初始化 / VKBuilder / 异步帧、buffers、数据流、函数与 shader)
- 体积光模块
- 抗锯齿模块
- 风格化渲染模块
- GUI 框架
- Tilemap
- 寻路系统
- 动态视野系统
- 程序化生成模块
- 体积光模块
- 环境光遮蔽模块
- 风格化渲染模块
- RPG 系统
- 背包系统
- 建筑放置系统
- 空间索引模块
- 游戏模型
- 界面设计
- 修改思路
实施记录
阶段性设计稿与实施计划位于 superpowers/。文档使用的图示位于 img/。
构建与文档
-
生成 C++ API 文档(Doxygen):
make docs(或cmake --build <build-dir> --target docs), 产物位于docs/api/html/(已加入.gitignore)。需要先安装 doxygen: Ubuntu/WSLsudo apt install doxygen、macOSbrew install doxygen、Windowschoco install doxygen。 文档配置见docs/Doxyfile.in与docs/CMakeLists.txt,入口src/、Readme.md与docs/usr/。 -
运行时断言:引擎统一通过 zeroerr 的
ASSERT系列宏做函数参数校验与内部不变量检查, 入口见src/engine/common/Assert.h(EV_PARAM_CHECK/EV_ASSERT)。- Debug 构建默认启用;
- Release 等非 Debug 构建默认通过
ZEROERR_NO_ASSERT编译剔除,零运行时开销; - 需要手动开启时:
make build/linux CMAKE_EXTRA_ARGS=-DEVENGINE_ENABLE_ASSERTS=ON(或 CMake 配置时加-DEVENGINE_ENABLE_ASSERTS=ON)。
如果你是使用 EVEngine 制作游戏,而不是修改引擎,请从用户指南开始。