Skip to content

[Feature] Add SkyEnvironment snapshots and fallback lifecycle #801

Description

@JeanPhilippeKernel

Type

  • Bug
  • Feature
  • Refactor / cleanup
  • Task / chore

Overview

Create the scene sky coordinator and immutable GPU snapshots that guarantee valid environment resources throughout loading, baking, replacement, and failure.

Context

SkySystem coordinates revisions; SkyEnvironment owns persistent resources and publishes fallback, baking, ready, or failed snapshots. Only the render thread may mutate Vulkan state.

What needs to be done

  • Implement revision-tagged SkyEnvironment snapshots and a render-thread mailbox for immutable SkyConfig updates.
  • Create and publish an always-valid fallback environment before normal sky work.
  • Pin selected snapshots for submitted frames and retire them only after timeline completion.
  • Coalesce edits and discard stale worker completions.
  • Surface actionable bake and fallback diagnostics.

Resources

  • ZEngine/docs/future-plan/sky-rendering.md sections 3 and 7

Testing

Test first-frame fallback, rapid edits, stale completion rejection, snapshot replacement, and deferred retirement under in-flight frames.

Acceptance criteria

  • No frame binds an invalid environment resource.
  • Prior snapshots remain valid until all consuming submissions retire.
  • A failed or loading environment preserves a visible fallback.
  • Worker threads never write Vulkan descriptors or shared environment state.
  • Builds without warnings in Debug and Release.
  • All relevant unit tests pass.
  • No regression in existing functionality.

Estimated effort

3-5 days.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions