Subviewport render fix#1303
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughViewport rendering now records sibling texture-consumption dependencies each frame, topologically orders sibling viewports so consumers render before producers, falls back on cycles, and invalidates ordering when parent relationships change. ChangesViewport dependency ordering
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant RendererViewport
participant ViewportRenderTargets
participant ActiveViewportSorter
RendererViewport->>ViewportRenderTargets: Snapshot render_target_was_used()
RendererViewport->>ViewportRenderTargets: Render current viewport
ViewportRenderTargets-->>RendererViewport: Report newly used sibling targets
RendererViewport->>RendererViewport: Update used_by_viewport
RendererViewport->>ActiveViewportSorter: Mark sorted ordering dirty
ActiveViewportSorter->>ActiveViewportSorter: Topologically sort sibling viewports
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Shakai-Dev
left a comment
There was a problem hiding this comment.
Fix LGTM, just needs testing to see if it works
Wow, quick on the trigger :). I did provide a test build to https://github.com/Flashfyre and he said it was working for him. It's probably worth checking in with him to see if that's still the case tomorrow. |
|
Just checked with Sam, he wasn't able to reproduce the bug on the test build, think we're in good shape. |
Shakai-Dev
left a comment
There was a problem hiding this comment.
Tested by the author of the issue & myself, lgtm.
Fixes #1283
The bug results from an issue handling viewport "siblings" at the same level in a parent-child hierarchy. They were sorted by RID, which causes problems depending on what order they were added to the scene tree, etc...
If the viewport's texture is consumed by a sibling viewport, it needs to be rendered first. or else the sibling can get a stale texture, hence epilepsy flicker texture.
This adds/uses a property to the Viewport struct to track if a viewport's texture is consumed by another.
This gives us the info we need to build a dependency graph, and sort the sibling viewports.
Summary by CodeRabbit