refactor Scene to have an intrinsic MultiUpdateDelegate#285
Merged
jeffamstutz merged 2 commits intonext_releasefrom Apr 24, 2026
Merged
refactor Scene to have an intrinsic MultiUpdateDelegate#285jeffamstutz merged 2 commits intonext_releasefrom
jeffamstutz merged 2 commits intonext_releasefrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors tsd::scene::Scene to intrinsically own a MultiUpdateDelegate root (instead of optionally storing a single delegate pointer), and updates rendering/UI/scripting call sites to register observers via scene.updateDelegate().emplace()/erase().
Changes:
- Replaced
Scene::setUpdateDelegate()/nullable delegate pointer with an always-presentMultiUpdateDelegateroot (Scene::updateDelegate()). - Updated render-index creation/lifecycle to be scene-owned (including Lua bindings and device-manager ref counting) and adjusted
RenderIndex::populate()semantics. - Added a Catch2 test suite validating intrinsic delegate behavior and registration/erasure signaling.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsd/tests/test_Scene.cpp | Adds tests covering intrinsic MultiUpdateDelegate root behavior and live signaling control. |
| tsd/tests/CMakeLists.txt | Registers the new Scene test in the test target and CTest. |
| tsd/src/tsd/ui/imgui/windows/Viewport.cpp | Updates render-index release to pass the owning Scene. |
| tsd/src/tsd/ui/imgui/windows/MultiDeviceViewport.h | Tracks render-index pointers per device for multi-device viewport. |
| tsd/src/tsd/ui/imgui/windows/MultiDeviceViewport.cpp | Stores render-index pointers directly and updates teardown to release via scene-aware API. |
| tsd/src/tsd/ui/imgui/windows/CameraPoses.cpp | Updates render-index release to pass the owning Scene. |
| tsd/src/tsd/ui/imgui/Application.cpp | Updates render-index release calls to pass the owning Scene. |
| tsd/src/tsd/scripting/tsd.lua | Updates Lua docs/comments for RenderIndex:populate() and scene-owned live render indices. |
| tsd/src/tsd/scripting/bindings/RenderBindings.cpp | Makes createRenderIndex() return a scene-owned render index pointer and adjusts APIs accordingly. |
| tsd/src/tsd/scripting/README.md | Updates scripting example to reflect the scene-owned live render index behavior. |
| tsd/src/tsd/scene/UpdateDelegate.hpp | Updates usage examples to register delegates via scene.updateDelegate().emplace<>(). |
| tsd/src/tsd/scene/Scene.hpp | Changes Scene’s delegate API to return a MultiUpdateDelegate& and stores it intrinsically. |
| tsd/src/tsd/scene/Scene.cpp | Removes setUpdateDelegate() plumbing; always signals through the intrinsic delegate root; adds destructor logging for leftover delegates. |
| tsd/src/tsd/scene/README.md | Documents that every Scene owns a MultiUpdateDelegate root. |
| tsd/src/tsd/rendering/index/RenderIndexFlatRegistry.hpp | Updates example to create indices via scene.updateDelegate().emplace<>(). |
| tsd/src/tsd/rendering/index/RenderIndexAllLayers.hpp | Updates example to create indices via scene.updateDelegate().emplace<>(). |
| tsd/src/tsd/rendering/index/RenderIndex.hpp | Changes populate() docs/signature to no longer register as the scene’s delegate. |
| tsd/src/tsd/rendering/index/RenderIndex.cpp | Updates populate() implementation to match the new signature/registration model. |
| tsd/src/tsd/app/renderAnimationSequence.cpp | Creates and erases a scene-owned render index for offline rendering runs. |
| tsd/src/tsd/app/Context.cpp | Removes old delegate-wiring at Context construction; routes filtering-change signaling via scene.updateDelegate(). |
| tsd/src/tsd/app/ANARIDeviceManager.h | Updates API to release render indices with a Scene& and removes the manager-owned delegate. |
| tsd/src/tsd/app/ANARIDeviceManager.cpp | Allocates scene-owned render indices via scene.updateDelegate() and ref-counts/erases them on release. |
| tsd/src/anari_tsd/World.cpp | Releases render index with the owning Scene when not using an external scene. |
| tsd/src/anari_tsd/Device.cpp | Removes Scene::setUpdateDelegate() usage during device init. |
| tsd/apps/tutorial/tsdTutorialMultiRender.cpp | Updates tutorial to use scene.updateDelegate() and the new populate() signature. |
| tsd/apps/interactive/network/server/RenderServer.cpp | Updates render-index release to pass the owning Scene. |
| tsd/apps/interactive/network/mpiServer/DistributedRenderServer.cpp | Updates render-index release and filtering-change signaling to go through the scene delegate root. |
| tsd/apps/interactive/network/client/tsdRemoteViewer.cpp | Registers the network delegate via scene.updateDelegate().emplace() and erases it on destruction. |
| tsd/apps/interactive/mpiViewer/DistributedSceneController.cpp | Updates render-index release to pass the owning Scene. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.