[Ready to merge] FSPX container parsing, slot 67 mapping, and diagnostic tracing for FSR4 upscaler #1468

Open
opened 2026-11-26 04:32:52 +00:00 by github-bot · 1 comment
Owner

@⁠Xvania7 on GitHub · 2026-11-24 18:16 UTC · original

This PR adds diagnostic infrastructure for the FSPX compute containers used by amd_fidelityfx_upscaler_xbox.dll (FSR4 post-process upscaler). It does not yet translate RDNA2 bytecode to DXIL — that remains future work — but it makes the problem visible and opens a path to force the engine's internal DXIL fallback.

What it does

  1. FSPX container parsing (crates/victory-shader/src/dxbc.rs):

    • Added FourCC::ACCC detection.
    • Implemented Fspx::parse() and inspect_fspx(), extracting NumThreadsX/Y/Z, wave32/wave64, RDNA2 code size, and kind 1/6/7 metadata.
    • translate() now returns an explicit Unsupported("FSPX compute module") instead of a misleading no DXIL part.
  2. Device slot 67 (DeserializeComputePipelineStateX) mapping (crates/victory-gpu/src/pipeline.rs):

    • Slot 67 (0x218) is now wired to return a configurable HRESULT (E_FAIL by default), zeroing the out pointer.
    • Environment variable VICTORY_SLOT67_HR allows testing E_FAIL, E_INVALIDARG, E_NOTIMPL, and S_OK without rebuilding.
    • Slot 62 (create_compute_x) can reject FSPX with VICTORY_FSPX_REJECT_SLOT62=1.
  3. Diagnostics:

    • Shader::translated() logs the shader hash, thread group dimensions, wave size, and container size for every FSPX module.
    • missing() in pipeline/make.rs now tags dropped pipelines as compute <hash> (FSPX compute module).

Why it matters

Before this change, the DLL's E_NOTIMPL on slot 67 caused it to fall back to slot 62, which returned S_OK with a "no-shaders PSO". Every dispatch was then dropped in draw.rs, leaving the 2560×1440 target at clear color (the black screen). With slot 67 mapped and configurable, testers can now observe how the DLL and the engine react to pipeline creation failures, and whether the engine's internal DXIL post-process fallback activates.

Verification

  • cargo test -p victory-shader — 54 passed
  • cargo test -p victory-gpu — 52 passed
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo xtask policy — 154 files ok

Branch: fix/issue-887-fspx-shaders (commit d7d0770)

Related: #887 (FSPX root-cause analysis), experiment/fspx-force-dxil (commit e60e91c, fallback experiment).

**@⁠Xvania7** on GitHub · 2026-11-24 18:16 UTC · [original](https://github.com/Marvisak/VIctory/issues/1468) This PR adds diagnostic infrastructure for the `FSPX` compute containers used by `amd_fidelityfx_upscaler_xbox.dll` (FSR4 post-process upscaler). It does not yet translate RDNA2 bytecode to DXIL — that remains future work — but it makes the problem visible and opens a path to force the engine's internal DXIL fallback. ### What it does 1. **FSPX container parsing (`crates/victory-shader/src/dxbc.rs`):** - Added `FourCC::ACCC` detection. - Implemented `Fspx::parse()` and `inspect_fspx()`, extracting `NumThreadsX/Y/Z`, `wave32/wave64`, RDNA2 code size, and kind 1/6/7 metadata. - `translate()` now returns an explicit `Unsupported("FSPX compute module")` instead of a misleading `no DXIL part`. 2. **Device slot 67 (`DeserializeComputePipelineStateX`) mapping (`crates/victory-gpu/src/pipeline.rs`):** - Slot 67 (`0x218`) is now wired to return a configurable HRESULT (`E_FAIL` by default), zeroing the out pointer. - Environment variable `VICTORY_SLOT67_HR` allows testing `E_FAIL`, `E_INVALIDARG`, `E_NOTIMPL`, and `S_OK` without rebuilding. - Slot 62 (`create_compute_x`) can reject FSPX with `VICTORY_FSPX_REJECT_SLOT62=1`. 3. **Diagnostics:** - `Shader::translated()` logs the shader hash, thread group dimensions, wave size, and container size for every FSPX module. - `missing()` in `pipeline/make.rs` now tags dropped pipelines as `compute <hash> (FSPX compute module)`. ### Why it matters Before this change, the DLL's `E_NOTIMPL` on slot 67 caused it to fall back to slot 62, which returned `S_OK` with a "no-shaders PSO". Every dispatch was then dropped in `draw.rs`, leaving the 2560×1440 target at clear color (the black screen). With slot 67 mapped and configurable, testers can now observe how the DLL and the engine react to pipeline creation failures, and whether the engine's internal DXIL post-process fallback activates. ### Verification - `cargo test -p victory-shader` — 54 passed - `cargo test -p victory-gpu` — 52 passed - `cargo clippy --all-targets -- -D warnings` — clean - `cargo xtask policy` — 154 files ok Branch: [`fix/issue-887-fspx-shaders`](https://github.com/Xvania7/VIctory/tree/fix/issue-887-fspx-shaders) (commit `d7d0770`) Related: #887 (FSPX root-cause analysis), `experiment/fspx-force-dxil` (commit `e60e91c`, fallback experiment).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:32:52 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:20 UTC · original

Automated triage for the maintainers.

This is a change on a fork branch (fix/issue-887-fspx-shaders, d7d0770), not a pull request. Pull requests are open to everyone now, so please open one against current main. No open PR carries this change yet.

Checked against main 940d32f:

  • ACCC containers already translate. translate_with (crates/victory-shader/src/emit/mod.rs) and with_resources (crates/victory-gpu/src/pipeline.rs) take the ACCC part when there is no DXIL part, and emit/valu_tests.rs runs such programs on the GPU. The part of the branch that makes translate() refuse FSPX modules would undo that, so it needs re-checking after a rebase.
  • Device slot 67 (0x218) is still not filled in crates/victory-gpu/src/device.rs, so wiring it may still be useful.

The background is in #887.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:20 UTC · [original](https://github.com/Marvisak/VIctory/issues/1468#issuecomment-7159560503) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T18:16:35Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. This is a change on a fork branch (`fix/issue-887-fspx-shaders`, `d7d0770`), not a pull request. Pull requests are open to everyone now, so please open one against current `main`. No open PR carries this change yet. Checked against `main` `940d32f`: - `ACCC` containers already translate. `translate_with` (`crates/victory-shader/src/emit/mod.rs`) and `with_resources` (`crates/victory-gpu/src/pipeline.rs`) take the `ACCC` part when there is no `DXIL` part, and `emit/valu_tests.rs` runs such programs on the GPU. The part of the branch that makes `translate()` refuse FSPX modules would undo that, so it needs re-checking after a rebase. - Device slot 67 (`0x218`) is still not filled in `crates/victory-gpu/src/device.rs`, so wiring it may still be useful. The background is in #887. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#1468
No description provided.