Skip to content

Improve iOS runtime and Metal support - #87

Open
tryk016 wants to merge 25 commits into
Try:masterfrom
tryk016:codex/ios-upstream-pr-ready
Open

Improve iOS runtime and Metal support#87
tryk016 wants to merge 25 commits into
Try:masterfrom
tryk016:codex/ios-upstream-pr-ready

Conversation

@tryk016

@tryk016 tryk016 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

This is the Tempest part of the iOS port I have been working on for OpenGothic.

The main goal was to add the missing iOS lifecycle support and expose the Metal features the application needs without putting OpenGothic-specific decisions into Tempest. The new rendering paths are optional and the existing defaults stay unchanged.

The PR adds safe iOS scene and window handling, support for the host application's orientation and frame-rate policy, MetalFX Spatial and Temporal scalers, an optional direct-drawable path, configurable frames in flight, a bounded shader cache and validated precompiled Metal libraries with runtime compilation as a fallback. It also contains a few small fixes found while testing the port, including iOS font fallback, Metal storage on the simulator and CTest compatibility on MSVC.

I kept the existing graphics API virtual-function order and verified that Vulkan and DirectX still build. MetalFX is weak-linked and checked at runtime, so it is not required on older systems or devices. The parent project also remains in control of the Apple deployment target.

Tested with the regular CTest suite and fresh macOS, iPhoneOS arm64 and iPhone Simulator arm64 builds. The full GitHub Actions matrix passed on Windows MSVC, Windows MinGW, Ubuntu and macOS:

https://github.com/tryk016/Tempest/actions/runs/33337161891

@Try

Try commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Hi, @tryk016 and thanks for PR!

It would be extremely hard to review in current state: it mixes up many individual things and large. PR has to be broken down in to several, for example:

  • trivial fixes in Painter2d
  • TextureFormat::RG16F
  • Font fixes
  • RFile.mm fixes
  • hostVisibleResourceOptions
  • swapchainFrames (not sure what this is mean to do, actually)
  • safe rect
  • display link
  • upscaler and others

Would be nice to merge simple stuff first, and then more hairy stuff. For one: I'm not sure, if upscaler is really useful. OpenGothic not generating any motion vectors/optical flow as this is quite expensive perf-wise. Without those temporal upscaler will ghost anywhere.

@tryk016

tryk016 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback,
I agree that the PR has grown too large to review effectively.

I’ll split it into small, focused PRs based on the latest master, starting with the independent fixes: Painter2d, TextureFormat::RG16F, font fallback, RFile.mm, and host-visible Metal resources. The iOS lifecycle, safe rect, display link, swapchain configuration, and other larger changes will follow separately.

swapchainFrames makes the CAMetalLayer drawable count configurable between two and three, allowing the application to match it with the number of frames in flight. The default behavior remains unchanged. I’ll keep this in a separate PR with a clearer explanation and tests.

Your concern about temporal upscaling is valid. The current port does not provide complete per-object motion vectors for animated or moving geometry, so ghosting is possible. I’ll leave the temporal MetalFX work out of the initial upstream series.

I’ll prepare the smaller replacement PRs first and link them here before closing this one.

@tryk016

tryk016 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks again for the feedback. I have now split out the first four independent changes, each based on the current master:

I’ll keep this PR open as the main discussion thread for the iOS work and add links to the next focused PRs here as they are prepared.

The larger lifecycle, safe rect, display link, swapchain configuration and other changes remain separate from this first batch.

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