amd_fidelityfx_loader_xbox: add AMD FidelityFX console loader shim crate #356

Open
FilimonEnc wants to merge 2 commits from upstream-pr/356 into main
FilimonEnc commented 2026-11-24 05:43:17 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by FilimonEnc on 2026-11-24T05:43:17Z.


Adds the crates/compat/amd_fidelityfx_loader_xbox crate:

  • Exports standard AMD FidelityFX console loader entry points: fxCreateContext, fxDestroyContext, fxDispatch, and fxQuery.
  • Implements memory management for context handles and return codes (FFX_OK, FFX_ERROR_INVALID_POINTER).
  • Validated with pr_gate.py and unit tests for lifecycle, null-pointers, and PE exports.
<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:6575480994 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/356). Originally posted by [FilimonEnc](https://github.com/FilimonEnc) on 2026-11-24T05:43:17Z. --- Adds the crates/compat/amd_fidelityfx_loader_xbox crate: - Exports standard AMD FidelityFX console loader entry points: fxCreateContext, fxDestroyContext, fxDispatch, and fxQuery. - Implements memory management for context handles and return codes (FFX_OK, FFX_ERROR_INVALID_POINTER). - Validated with pr_gate.py and unit tests for lifecycle, null-pointers, and PE exports.
omonkeyz commented 2026-11-25 13:51:42 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-25T13:51:42Z.


Thanks. ffxDispatch and ffxQuery return FFX_OK without running or answering anything, and ffxCreateContext returns a placeholder context, while exports.txt marks them implemented. The project does not take accept-and-drop shims. Could you implement them (for example by forwarding to the PC FidelityFX API or a real upscale path), or return an error code and mark the rows with their true status?

<!-- greyfinch-sync:omonkeyz/xbox-emulator:comment:7164397144 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/356#issuecomment-7164397144). Originally posted by [omonkeyz](https://github.com/omonkeyz) on 2026-11-25T13:51:42Z. --- Thanks. ffxDispatch and ffxQuery return FFX_OK without running or answering anything, and ffxCreateContext returns a placeholder context, while exports.txt marks them implemented. The project does not take accept-and-drop shims. Could you implement them (for example by forwarding to the PC FidelityFX API or a real upscale path), or return an error code and mark the rows with their true status?
FilimonEnc commented 2026-11-25 15:41:35 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by FilimonEnc on 2026-11-25T15:41:35Z.


Updated to fail honestly without a PC FidelityFX backend:

ffxCreateContext now sets *context = null and returns FFX_ERROR_BACKEND_API_ERROR (-2) instead of allocating a placeholder context.
ffxDestroyContext, ffxDispatch, and ffxQuery return FFX_ERROR_INVALID_POINTER on null pointers and FFX_ERROR_BACKEND_API_ERROR otherwise instead of returning FFX_OK.
Marked all 4 rows as stub in exports.txt and updated unit tests accordingly (cargo test -p amd_fidelityfx_loader_xbox and pr_gate.py pass).

Provenance: ffxCreateContext, ffxDestroyContext, ffxDispatch, and ffxQuery are imported directly from amd_fidelityfx_loader_xbox.dll in game_scarlett_master.exe's PE import table. Forwarding to a PC FidelityFX backend can be wired in a follow-up once tested against the title's passes.

<!-- greyfinch-sync:omonkeyz/xbox-emulator:comment:7167234336 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/356#issuecomment-7167234336). Originally posted by [FilimonEnc](https://github.com/FilimonEnc) on 2026-11-25T15:41:35Z. --- Updated to fail honestly without a PC FidelityFX backend: ffxCreateContext now sets *context = null and returns FFX_ERROR_BACKEND_API_ERROR (-2) instead of allocating a placeholder context. ffxDestroyContext, ffxDispatch, and ffxQuery return FFX_ERROR_INVALID_POINTER on null pointers and FFX_ERROR_BACKEND_API_ERROR otherwise instead of returning FFX_OK. Marked all 4 rows as stub in exports.txt and updated unit tests accordingly (cargo test -p amd_fidelityfx_loader_xbox and pr_gate.py pass). Provenance: ffxCreateContext, ffxDestroyContext, ffxDispatch, and ffxQuery are imported directly from amd_fidelityfx_loader_xbox.dll in game_scarlett_master.exe's PE import table. Forwarding to a PC FidelityFX backend can be wired in a follow-up once tested against the title's passes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/356:upstream-pr/356'
git switch 'upstream-pr/356'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/356'
git switch 'upstream-pr/356'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/356'
git switch 'upstream-pr/356'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/356'
git switch 'main'
git merge --squash 'upstream-pr/356'
git switch 'main'
git merge --ff-only 'upstream-pr/356'
git switch 'main'
git merge 'upstream-pr/356'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
omonkeyz/xbox-emulator!356
No description provided.