Skip to content

Add Metal swapchain presentation options - #113

Open
tryk016 wants to merge 2 commits into
Try:masterfrom
tryk016:codex/pr-tempest-metal-presentation
Open

tryk016 wants to merge 2 commits into
Try:masterfrom
tryk016:codex/pr-tempest-metal-presentation

Conversation

@tryk016

@tryk016 tryk016 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds per-swapchain options for two or three drawables and direct rendering into the drawable texture.

Defaults stay unchanged. Direct rendering avoids the private color buffers and the final copy, with a copy fallback when a matching drawable is unavailable. Recorded frames are kept alive until the GPU has finished using them.

Tested on macOS, iOS 18/27 simulators and an iPhone 15 Pro Max, including pixel readback, reset, fallback and resource lifetime checks.

Also tested in OpenGothic on macOS with Copy/Direct and both buffer counts.

@Try

Try commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Hi, @tryk016 !

Private color buffers are there because engine initially was build with Vulkan-like abstraction (and eventually DX12-like) over swapchain.
On DX12/Vulkan images are persistent, and application can LOAD_OP_LOAD them in next frames, or keep references to image-data and expect those to be valid until reset.

However this abstraction no longer relevant, and rather then patch current swapchain we should move to implementation that makes more sense.
In #110 I only drafted idea outline. Basically swapchain image can have very short life-time on game-side (single-frame only), like it is in Metal.

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