Skip to content

refactor Scene to have an intrinsic MultiUpdateDelegate#285

Merged
jeffamstutz merged 2 commits intonext_releasefrom
tsd_scene_delegate_refactor
Apr 24, 2026
Merged

refactor Scene to have an intrinsic MultiUpdateDelegate#285
jeffamstutz merged 2 commits intonext_releasefrom
tsd_scene_delegate_refactor

Conversation

@jeffamstutz
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-present MultiUpdateDelegate root (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.

Comment thread tsd/src/tsd/app/ANARIDeviceManager.cpp
Comment thread tsd/src/tsd/app/ANARIDeviceManager.cpp
Comment thread tsd/src/tsd/ui/imgui/windows/MultiDeviceViewport.cpp
Comment thread tsd/src/tsd/ui/imgui/windows/MultiDeviceViewport.cpp
Comment thread tsd/src/tsd/ui/imgui/windows/MultiDeviceViewport.h
Comment thread tsd/src/tsd/app/ANARIDeviceManager.h Outdated
@jeffamstutz jeffamstutz merged commit f3b18b9 into next_release Apr 24, 2026
12 checks passed
@jeffamstutz jeffamstutz deleted the tsd_scene_delegate_refactor branch April 24, 2026 15:37
@jeffamstutz jeffamstutz changed the title refactor Scene to having an intrinsic MultiUpdateDelegate refactor Scene to have an intrinsic MultiUpdateDelegate Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants