FSR: the shipping Xbox upscaler has one provider and one fixed configuration (static analysis, answers #302's open end)

Aperta
#780 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva

Direzione di ricerca

Start with Appendix A.3 of docs/d3d12_vulkan.md, which the issue asks to extend with measured rows, and check them against game/xbox-1.0.2.1.json for the DLL hashes. For the test side, look at fsr_dispatch_test and its existing OutputDebugString redirect used by the BVH test. Done means the A.3 rows are added and the FSR test surfaces the DLL's refusal message; the work has no clear owner yet and needs maintainer sign-off before a newcomer starts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Why this is here

Appendix A.3 of docs/d3d12_vulkan.md stops at the PE tables for amd_fidelityfx_upscaler_xbox.dll, and #302 records the open end: ffxCreateContext "returns ERROR without touching the device for every backend descriptor tried: the Xbox one isn't public". I read the DLL's own code to find out what it accepts. The answer is that it carries exactly one provider and one configuration, and it prints the reason for every refusal.

Method

Static analysis only, Ghidra 12.2 on Linux, on our own 1.0.2.1 copy. The four DLLs were copied to a work folder outside the package first and checked against game/xbox-1.0.2.1.json by SHA-256 (upscaler faff02f2…, loader 431bdd2e…, XboxBvhBuilder.dll 99f803ac…, Bink2Scarlett.dll 9eaf045d…). Nothing was executed. Nothing from the DLLs is attached or quoted beyond the message text needed to describe behaviour. No keys, no decryption.

Measured

One provider, one effect. The module's TLS initialiser builds a two-record table and publishes it as a one-pointer registry: the registry spans 0x1800beb68 to 0x1800beb70, so it holds a single entry, and the provider record is named ffxProvider_FSR4_Int8. Its model record is named Fsr4Int8UpscalerModel and carries the version string 4.1.1 and an id word 0xf5a5ca1e01001001. There is no second backend in this DLL to try, which matches the "one provider, 4.1.1" line in #302.

Where the rejection happens. ffxCreateContext (0x1800011d0) walks the parameter chain for four keys (4, 5, 0x10009, 0x1000002), then for the provider calls vtable slot +0x8 with the device value and slot +0x10 with the version value. If neither accepts it returns 4. The DLL's own text names 4: FFX_API_RETURN_NO_PROVIDER (4), in a message that reads ... No device found in descriptor chain. For null-context queries to reach driver/external providers, chain an ffxCreateBackendDX12Desc (with device set) via header.pNext. So a chain that carries no device is refused before any device method runs, which is exactly the "without touching the device" symptom. Slot +0x18 is the create call, slot +0x0 the release.

One accepted configuration. The create path compares against literals and prints a different message for each mismatch:

field what the code compares message
output resolution 0x780 by 0x438 part of the must be %ux%u family
renderSize 0x500 by 0x2d0 Only the fixed Quality input geometry for this context's output resolution is included.
upscaleSize must equal the output size Shipping FSR4 configuration mismatch: %ls must be %ux%u; received %ux%u. %ls
flags, required three separate bit tests ... is missing FFX_UPSCALE_ENABLE_HIGH_DYNAMIC_RANGE, ... FFX_UPSCALE_ENABLE_DEPTH_INVERTED, ... FFX_UPSCALE_ENABLE_AUTO_EXPOSURE
flags, forbidden one bit test ... enables FFX_UPSCALE_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS, but only the low-resolution motion-vector prepass permutation is included.
flags, anything else mask test Shipping FSR4 configuration mismatch: %ls contains unsupported flag bits 0x%08X.

1920x1080 out from 1280x720 in, Quality, HDR, inverted depth, auto exposure, low-resolution motion vectors. That is the whole search space, which is the same configuration #302 found by probing.

Two pipeline sources, and a fallback that tells you which it used. The create path first looks for an ACCC part and builds compute PSOs by deserializing it, allocating with XMemAlloc; on each failure it logs a distinct line and falls back: no usable 'ACCC' part (extract result=%d) for '%ls' -- is this an ACO-cooked DLL? falling back to NewBE, XMemAlloc(%zu) FAILED ..., DeserializeComputePipelineStateX FAILED hr=0x%08X ... falling back to NewBE, and on success compute PSO created via ACO ('ACCC'). Two ASCII names, FFX_FSR4_XBOX_ACO and FFX_FSR4_XBOX_ACO_ACTIVE, sit near that code; I did not confirm they are environment variables, so I am not claiming it.

Every refusal is printed. Each mismatch formats a wide string and sends it to OutputDebugStringW with the prefix FSR_API_DEBUG_ERROR: , unless a callback pointer is installed at 0x1800beb60, in which case the DLL calls it with the message. A flag at 0x1800bc0a0 gates both. fsr_dispatch_test already redirects OutputDebugString for the BVH test, so wiring the same redirect into the FSR test turns the current single "returns ERROR" into the exact reason, with no new dependencies.

Not measured

The DLL was not run, so nothing here is a runtime trace. The offsets and slot numbers are the decompiler's reading of this build. I list the flag requirements by the DLL's messages rather than by bit position, because the decompiler showed bit tests inside the descriptor and I did not map each one to a published FFX_UPSCALE_* value.

Ask

If this is useful I can put it into docs/d3d12_vulkan.md A.3 as measured rows, in the style of A.2, and note the callback at 0x1800beb60 as the cheap way to get the DLL's own reason out of fsr_dispatch_test. Say the word and I will send a docs change.

AI-assisted (Halocline, a local model, in HADAL): it ran the analysis, read the decompiled functions and wrote this.

Lingua principale
Python
Stelle
14.9k
Fork
1.2k
Merge medio
1h 58m
PR unite (30g)
40

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ItsNotRexed/Leonida

Tutte le issue di ItsNotRexed/Leonida

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.