Composer
Manage retained scenes, animation, frame preparation, and input policy without owning Vulkan resources.
The composer prepares accepted client state for a particular presentation opportunity. It determines the scene's retained structure, composition, and animated values, then passes a snapshot to the renderer. That boundary keeps composition policy independent of the Vulkan resources and commands used to draw the result.
Atomic Commit Admission
Before a diff reaches retained state, the server checks that its client owns the target surface. The composer then validates the operations and publishes them as one update. The server reports that publication with CommitAccepted, or identifies the rejected surface and commit in CommitRejected if validation fails.
Admission also limits how much pending commit work the system retains. When that capacity is temporarily exhausted, the connection waits for space instead of treating the request as malformed. A client can therefore distinguish resource pressure from a semantic rejection of its scene.
Scene Preparation
The frame driver calls prepare_frame_for_presentation with its predicted presentation instant. The composer samples animations for that instant and prepares the scene snapshot and submission bookkeeping together.
Sampling at the intended presentation time aligns animation values with when the frame is expected to appear. It is still a prediction: GPU or display delays can change the actual activation time.
Submission Ownership
The prepared scene carries a submission object that tracks which accepted commits it represents. Once renderer submission succeeds, the server claims those records and emits their CommitAcks. If rendering is blocked or fails, the records remain available for a later attempt, preserving the relationship between an acknowledgment and successful GPU submission.
Because preparation samples the current retained state, one submitted frame can represent several accepted client updates. Acceptance establishes which scene a client can use as its baseline, while submission reports that work covering those updates reached the GPU. Intermediate accepted states need not appear as separate display frames.
Input Policy
Input policy uses the same retained composition boundaries to resolve surface transforms, hit behavior, and seat ownership. Because pointer, touch, and keyboard streams have different ownership rules, the composer applies the appropriate policy to prepared or confirmed scene information rather than reaching into mutable renderer state.
Continue with building a frame, animation and scheduling, and input and focus.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/composer/src/composer.rscrates/composer/src/composer/pending_commits.rscrates/composer/src/frame.rscrates/server/src/frame/mod.rs