Proposal: serve the title's FidelityFX upscaler with MetalFX on Apple hosts (and MetalFX frame interpolation later) #375
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Hayyan612 on 2026-11-27T14:35:02Z.
Proposal, not claimed. Writing it down for discussion before anyone builds it; I can't verify it in a game run yet.
Idea
modules/fidelityfx.rsalready intercepts the title's FidelityFX API (ffxCreateContext/ffxConfigure/ffxQuery/ffxDispatch) and passes it to a PC FidelityFX build whenVICTORY_FIDELITYFX_DIRnames one. On Apple hosts, the same seam could serve the upscale with MetalFX Temporal (MTLFXTemporalScaler) instead, from the inputs the dispatch already carries: colour, depth and motion vectors (host copies viavictory_gpu::external), jitter, motion-vector scale, render and output sizes, reset.Why it may help on Macs:
Frame generation (later)
The module refuses FidelityFX frame generation today. macOS/iPadOS 26 have MetalFX frame interpolation (
MTLFXFrameInterpolator), fed by the same depth, motion and camera values. Another project reports this on its own title (God of War III on Apple Silicon, M4 Pro): 53 fps native, 67 with MetalFX Temporal, about 117 shown with interpolation. Different game, so only an indication.Prior art
MTLFXFrameInterpolator.Open questions
VICTORY_METALFX=1), asVICTORY_FIDELITYFX_DIRis.Refs #8 (memory and frame rate on 16 GB Macs), #179 (world frame rate).
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-27T14:50:16Z.
Claiming. Plan, grounded in the current code:
ffxDispatchalready resolves all seven resources (colour, depth, motion, exposure, reactive, transparent, output) to host textures viaexternal::host_texture, andDispatchUpscaleis fully decoded (0x1b0;rest[18]= jitter, mv scale, sizes, sharpening, frame time, pre-exposure, reset, camera, flags - pass-through today). So an Apple provider replaces only the backend, not the interception.objc2-metal-fxintovictory-metal; oneMTLFXTemporalScalerframe over synthetic textures, output dumped and diffed. Settles the API surface and format support set with no title needed.VICTORY_METALFX=1:CREATE_UPSCALEbuilds anMTLFXTemporalScalerDescriptorfromCreateUpscale(max sizes; flags -> auto-exposure / reactive / transparent).once!refuse otherwise), auto vs texture exposure. Jitter/sizes/reset fromrest[18]; sharpening has no MetalFX equivalent.VICTORY_DUMP_TARGETSFSR vs MetalFX on the same frames, frame meter, 10+ min stability.docs/native-host.mdentry, parity notes, gate green (#370). Frame interpolation is out of scope here; the seam stays open for it. Implemented from Apple's MetalFX docs only; OptiScaler is prior art for the idea, not code.Corrections welcome before I start.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Hayyan612 on 2026-11-27T15:29:16Z.
Thanks @wz11wz, that plan looks right, and a dump-and-compare against FSR on the same frames is the check it needed.
One small request: MetalFX (
MTLFXTemporalScaler, and laterMTLFXFrameInterpolator) also exists on iOS and iPadOS, so gating the new code ontarget_vendor = "apple"rather thantarget_os = "macos"would keep it usable on any Apple host at no cost on the Mac.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T17:57:03Z.
/claim — starting with the piece both halves need.
What I found reading it today.
victory_metal::metalfxalready wraps all three objects (Spatial,Temporal,Interpolator), and each has a GPU test that encodes one and waits for the command buffer.metalfx::spatial()is even on a path (VICTORY_METALFX=spatialscales the presented plane). What is missing is not a MetalFX object but a seam: nothing outsidevictory-metalcan hand MetalFX a title texture, becausegfx::Texture'sMTLTextureis private.Where the inputs come from. The dispatch this module already parses carries exactly MetalFX's inputs, in
DispatchUpscale:resources[0..7]are colour, depth, motion vectors, exposure, reactive, transparency and output, as the title'sID3D12Resourcepointers, then jitter, motion-vector scale, render and output sizes, sharpening, frame time, pre-exposure and reset inrest.victory-gpu/src/native/textures.rskeys its texture registry by that same pointer (TextureInfo,texture_of,target_of), so a resource pointer is enough to reach the backend texture — no title-side identification of the depth or motion pass is needed, which is what the module's comment says is missing.Plan, in slices.
metalfx::Upscale: one scaler chosen fromMode { Spatial, Temporal }— temporal when the dispatch carries depth and motion vectors and the OS has it, spatial otherwise — with the descriptor formats derived from the textures the caller hands it. Both modes encoded, GPU-tested. This is the foundation for both halves.ffxDispatch's upscale with it (SR), on the native path: the title's own FidelityFX DLL runs there today, so this is a provider inmodules/fidelityfx.rsrather than theVICTORY_FIDELITYFX_DIRpath, which needs a Windows DLL.Interpolatorbetween them and present the generated frame in between. The UI texture stays unset first, so a first version interpolates the HUD with the scene.Blocker, stated up front. The folder on this machine is 66% downloaded and
shaders.rpfreads as zeros (#632), so a run cannot validate anything yet. Slice 1 is verifiable here (GPU tests); slices 2 and 3 will need a run on complete data.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T17:57:12Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #375in its description within 24 hours, or the claim expires.