Update from task 2d627b0c-a9fa-4455-8d79-07dc3164b345#29
Conversation
- Validate dependency direction in RenderGraph::compile to enforce from < to for correct execution order - Use stored dependencyFlags in PassLevelDependency when calling vkCmdPipelineBarrier - Update RenderGraphBuilder documentation to clarify dependency ordering requirements - Add error handling for invalid dependency indices and directions during compilation
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoFix Vulkan render graph dependency validation and flag usage
WalkthroughsDescription• Validate dependency direction in RenderGraph::compile to enforce from < to ordering • Use stored dependencyFlags in PassLevelDependency when calling vkCmdPipelineBarrier • Add error handling for invalid dependency indices and directions during compilation • Update RenderGraphBuilder documentation to clarify dependency ordering requirements Diagramflowchart LR
A["Dependency Validation"] -->|"Check from < to"| B["Error Handling"]
B -->|"Invalid direction"| C["Runtime Exception"]
D["PassLevelDependency"] -->|"Collect flags"| E["combinedDependencyFlags"]
E -->|"Pass to barrier"| F["vkCmdPipelineBarrier"]
G["Documentation"] -->|"Clarify ordering"| H["RenderGraphBuilder"]
File Changes1. FarmEngine/src/rendering/graph/RenderGraph.cpp
|
Code Review by Qodo
1. BY_REGION weakens barriers
|
There was a problem hiding this comment.
This PR adds important validation and fixes for render graph dependency handling. The changes properly validate dependency direction and correctly propagate dependency flags to pipeline barriers. No blocking issues identified - the implementation is correct and improves robustness.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
There was a problem hiding this comment.
Code Review
This pull request reorganizes the .gitignore file for better clarity and introduces a validation check in the RenderGraph to ensure that producer passes are defined before consumer passes. It also implements the aggregation of dependency flags for pipeline barriers. Feedback was provided regarding the use of combinedDependencyFlags in vkCmdPipelineBarrier, noting that VK_DEPENDENCY_BY_REGION_BIT requires all involved pipeline stages to be graphics-related to avoid Vulkan validation errors or undefined behavior when compute or transfer stages are present.
| srcStage, | ||
| dstStage, | ||
| 0, | ||
| combinedDependencyFlags, |
There was a problem hiding this comment.
Using combinedDependencyFlags (which currently aggregates VK_DEPENDENCY_BY_REGION_BIT for pass-level dependencies) in vkCmdPipelineBarrier without validating the pipeline stages is risky. According to the Vulkan specification, VK_DEPENDENCY_BY_REGION_BIT can only be used if all pipeline stages in srcStageMask and dstStageMask are graphics stages. If any barrier in this call (including resource barriers) involves compute (VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) or transfer stages, this will result in a validation error or undefined behavior. Consider only applying this flag if the aggregated stages are compatible with graphics-only operations.
This PR was created by qwen-chat coder for task 2d627b0c-a9fa-4455-8d79-07dc3164b345.