Clarify render ownership and synchronize presentation teardown - #96
Merged
Merged
Conversation
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.
Siwin renderers could retain their host window while the window's render callback retained the renderer, preventing immediate cleanup. Borrow the host window instead and require callers to keep it alive through rendering and renderer destruction. Add
finishPendingFramesso hosts can wait for submitted GPU work before destroying presentation targets.Render data now has an explicit downward-only ownership contract. Only the recursive
RenderFragmentand diagnosticRenderTreeneed{.acyclic.}; Nim infers the remaining render-data types. Fragment moves already reject self/descendant attachment, and new regressions preserve that invariant. Renderer and backend types remain cycle-capable.The ownership guide documents exclusive ARC/ORC transfer, the borrowed window lifetime, and the separate requirement to retire source-thread ORC registrations before transferring a renderer. Merenda handles that final step for renderer commands in elcritch/merenda#117. Prepare version 0.43.0 for this API addition.
Validation on macOS/arm64, Nim 2.2.12:
pkg/vulkan; its completion operation usesvkDeviceWaitIdle.FigDraw tests:
This change covers the static Siwin integration. Other window shims and the native dynlib retain their existing lifetime contracts. OS-driven teardown barriers on Windows/X11 remain separate Siwin work.