Viewer: add MetalFX frame generation #132

Manually merged
github merged 3 commits from gh-pr/132/head into gh-pr/132/base 2026-11-26 20:12:16 +00:00
Owner

@⁠maple-quartz18 on GitHub · 2026-11-24 07:16 UTC · original
maple-quartz18:feature/metalfx-frame-generation → master · +720 −86 · 8 files · 3 commits · merged 2026-11-24 11:23 UTC

Summary

  • add an opt-in MTL4FX frame interpolation path for the macOS Metal 4 viewer
  • limit scene and Temporal Scaler work to 60 Hz while alternating real and interpolated presentation on 120 Hz UI redraws
  • reset interpolation history on resize and mode/resource changes, with native MTL4 and WGPU fallbacks preserved
  • validate 120 Hz display capability, separate fallback counts, and synchronize previous-frame reuse with a Metal 4 barrier
  • pin the expanded Metal-Rust safe facade and use checked AppKit window attachment instead of raw Objective-C layer pointers
  • add pacing/state tests and extend the Metal 4 example for runtime verification

Validation

  • cargo check --locked -p sixng-gui --features metal4-poc
  • cargo build --release --locked
  • cargo test --release --locked
  • 32 MTL4 feature tests with Metal API + shader validation
  • Apple M6 / 120 Hz display: 16.839 ms median real-frame cadence, 8.33 ms median present cadence, 98.55% of sampled HUD intervals at 8.33 ms, and 2280 real / 2279 interpolated / 1 fallback presents with no Metal validation errors

Notes

  • Metal-Rust now maps the full official Metal 27 metal-cpp header inventory (5,226 declarations) and supplies inherited MTL4FX properties safely.
  • Frame generation remains opt-in and disables itself if the active display is not 120 Hz.
  • Automated visual capture was unavailable because Screen Recording permission was not granted.
**@⁠maple-quartz18** on GitHub · 2026-11-24 07:16 UTC · [original](https://github.com/holdmysocks/SixNG/pull/132) `maple-quartz18:feature/metalfx-frame-generation` → `master` · +720 −86 · 8 files · 3 commits · merged 2026-11-24 11:23 UTC ## Summary - add an opt-in MTL4FX frame interpolation path for the macOS Metal 4 viewer - limit scene and Temporal Scaler work to 60 Hz while alternating real and interpolated presentation on 120 Hz UI redraws - reset interpolation history on resize and mode/resource changes, with native MTL4 and WGPU fallbacks preserved - validate 120 Hz display capability, separate fallback counts, and synchronize previous-frame reuse with a Metal 4 barrier - pin the expanded Metal-Rust safe facade and use checked AppKit window attachment instead of raw Objective-C layer pointers - add pacing/state tests and extend the Metal 4 example for runtime verification ## Validation - `cargo check --locked -p sixng-gui --features metal4-poc` - `cargo build --release --locked` - `cargo test --release --locked` - 32 MTL4 feature tests with Metal API + shader validation - Apple M6 / 120 Hz display: 16.839 ms median real-frame cadence, 8.33 ms median present cadence, 98.55% of sampled HUD intervals at 8.33 ms, and 2280 real / 2279 interpolated / 1 fallback presents with no Metal validation errors ## Notes - Metal-Rust now maps the full official Metal 27 metal-cpp header inventory (5,226 declarations) and supplies inherited MTL4FX properties safely. - Frame generation remains opt-in and disables itself if the active display is not 120 Hz. - Automated visual capture was unavailable because Screen Recording permission was not granted.
Add opt-in MTL4 frame interpolation with 60 Hz scene rendering and 120 Hz real/interpolated presentation. Preserve native fallback paths and cover pacing, history reset, resize, and capability failure paths.

Co-authored-by: Copilot <[email protected]>
Separate real-render gating from presentation phase, synchronize the previous-frame copy with a Metal 4 barrier, track fallback presents accurately, and gate pacing on a 120 Hz display.

Co-authored-by: Copilot <[email protected]>
Pin the Metal 27 inherited API revision and replace raw CAMetalLayer/AppKit pointer handling with Metal-Rust's checked window-handle attachment API.

Co-authored-by: Copilot <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:12:14 +00:00
github manually merged commit acdef2741d into gh-pr/132/base 2026-11-26 20:12:16 +00:00
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-24 11:53 UTC · original · edited 2026-11-24 11:55 UTC

It would be great if someone could implement open-source FSR3 frame generation support for Windows and Linux. This could provide a portable frame-generation backend alongside the macOS MetalFX path. The implementation should reuse the existing real-frame, motion-vector, depth, previous-frame, and presentation abstractions while preserving native 60 FPS fallbacks on each platform.

**@⁠maple-quartz18** on GitHub · 2026-11-24 11:53 UTC · [original](https://github.com/holdmysocks/SixNG/pull/132#issuecomment-7130689093) · edited 2026-11-24 11:55 UTC It would be great if someone could implement open-source FSR3 frame generation support for Windows and Linux. This could provide a portable frame-generation backend alongside the macOS MetalFX path. The implementation should reuse the existing real-frame, motion-vector, depth, previous-frame, and presentation abstractions while preserving native 60 FPS fallbacks on each platform.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-24 12:13 UTC · original

Thanks, and thanks again for the frame generation work! FSR3 frame generation for Windows and Linux is a good idea and it's now on our list. It isn't scheduled yet. If you or anyone else wants to pick it up, a PR along the lines you describe (reusing the existing frame inputs, opt-in, with the 60 FPS fallback kept) would be very welcome.

**@⁠holdmysocks** on GitHub · 2026-11-24 12:13 UTC · [original](https://github.com/holdmysocks/SixNG/pull/132#issuecomment-7131141425) Thanks, and thanks again for the frame generation work! FSR3 frame generation for Windows and Linux is a good idea and it's now on our list. It isn't scheduled yet. If you or anyone else wants to pick it up, a PR along the lines you describe (reusing the existing frame inputs, opt-in, with the 60 FPS fallback kept) would be very welcome.
This discussion has been locked. Commenting is limited to contributors.
No description provided.