Draft
重构并增强渲染图(Render Graph)系统:修复异步计算Pass裁剪Bug,实现Load/Store自动推导与Pass合并#7
Conversation
Co-authored-by: haolange <12471727+haolange@users.noreply.github.com>
Co-authored-by: haolange <12471727+haolange@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] 任务:重构并增强渲染图(Render Graph)系统
核心目标:
提升 Render Graph (RG) 的自动化程度与执行效率。具体分为三大块:修复异步计算(Async Compute)的Pass裁剪(Culling)Bug,实现颜色附件(Color Attach...
重构并增强渲染图(Render Graph)系统:修复异步计算Pass裁剪Bug,实现Load/Store自动推导与Pass合并
Aug 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本PR完成了对Render Graph (RG)系统的全面重构和增强,解决了三个核心问题并显著提升了自动化程度与执行效率。
🔧 修复异步计算Pass的裁剪Bug
问题:当一个
EnableAsyncCompute的ComputePass写入的资源没有被后续Pass读取时,即使使用AllowPassCulling(false)强制保留,仍会在编译或执行阶段出现错误,因为依赖图中缺少从异步计算Pass到后续Pass的边。解决方案:修改了
CullingUnusedPass()方法中的依赖分析逻辑,将强制保留的异步计算Pass视为依赖图的"根节点",确保它们不会被错误裁剪。🎨 实现附件Load/Store Action自动推导
变更:移除了
SetColorAttachment和SetDepthStencilAttachment中的LoadAction/StoreAction参数,引入语义化的访问标志。新的API设计
智能推导算法
在
GraphBuilder.Compile()期间,系统根据Pass间的拓扑依赖关系和访问意图自动推导最优的Load/Store Action:DontCare以节省GPU带宽🔄 实现自动Pass合并
新增了智能Pass合并功能,能够识别连续的光栅Pass序列并将其合并到单个RenderPass中执行。
合并条件检查
开发者控制
📊 性能收益
🔄 API迁移
所有现有的Pass都已更新到新的API:
🛡️ 向后兼容性
EDepthAccess枚举以确保现有逻辑正常工作EDepthAccessFlag会自动转换为相应的EDepthAccess值BeginRasterPass中正确处理ReadOnly深度访问的SubPassFlags.ReadOnlyDepthStencil此重构显著提升了RenderGraph系统的易用性和性能,为开发者提供了更加语义化和自动化的渲染管线编程体验。
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.