runtime: default to native shaders and Opus decoding #3449

Merged
R0Y00 merged 1 commit from upstream-pr/3449 into main 2026-11-29 11:32:40 +00:00
R0Y00 commented 2026-11-29 11:09:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-29T11:09:12Z.


Refs #2935 and #1145.

Default startup configuration

  • Windows and Wine launchers use the in-process C++ shader translator and its persistent cache when rendering is enabled. The default mode disables legacy shader fallback and reads the DXC directory from the build. The launcher accepts an explicit DXC override and reports missing DLLs before starting the title. The existing -Translate and --translate switches still opt into the Python watcher for legacy experiments.
  • Windows builds enable Opus packet decoding by default. CMake uses an installed static libopus or builds Xiph's 1.5.2 release after checking its SHA-256. The launchers default XApu typed completions to on. The build and launcher retain their explicit audio opt-outs.

Verification

Release at 75db835a, Windows 11 build 26200.9974, MSVC 19.51.36244, Windows SDK/DXC 10.0.26100.0, RTX 4060 Laptop GPU driver 616.56, and WARP 10.0.26100.9818. The Wine launcher check ran with a synthetic Wine stub on Ubuntu 22.04 under WSL.

python -B tests/startup_run_ps1_check.py
ctest --preset release --no-tests=error -R '^startup_native_graphics_draw_(hardware|warp)$'
ctest --preset release --no-tests=error -R '^startup_xapu_(queue|opus|opus_count)$'
cmake --preset release -B out/build/opus-archive-check -DCMAKE_DISABLE_FIND_PACKAGE_Opus=ON
cmake --build out/build/opus-archive-check --target startup_xapu_queue_check startup_xapu_opus_check startup_xapu_opus_count_check
ctest --test-dir out/build/opus-archive-check --no-tests=error -R '^startup_xapu_(queue|opus|opus_count)$'
python3 -B tests/startup_run_sh_check.py
  • Both launcher suites passed. The PowerShell suite ran under Windows PowerShell and PowerShell 7.
  • The native graphics fixtures passed on WARP and hardware (2/2).
  • The XApu queue, Opus decode, and Opus counter fixtures passed with the installed package and with the source build (3/3 each). The clean build used the downloaded official archive staged in CMake's download cache. CMake checked the hash and built the static library.
  • Validation used source-built fixtures. Actual button audio and the prologue watchdog were outside this run.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5550119474 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3449). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-29T11:09:12Z. --- Refs #2935 and #1145. ## Default startup configuration - Windows and Wine launchers use the in-process C++ shader translator and its persistent cache when rendering is enabled. The default mode disables legacy shader fallback and reads the DXC directory from the build. The launcher accepts an explicit DXC override and reports missing DLLs before starting the title. The existing `-Translate` and `--translate` switches still opt into the Python watcher for legacy experiments. - Windows builds enable Opus packet decoding by default. CMake uses an installed static libopus or builds Xiph's 1.5.2 release after checking its SHA-256. The launchers default XApu typed completions to on. The build and launcher retain their explicit audio opt-outs. ## Verification Release at `75db835a`, Windows 11 build 26200.9974, MSVC 19.51.36244, Windows SDK/DXC 10.0.26100.0, RTX 4060 Laptop GPU driver 616.56, and WARP 10.0.26100.9818. The Wine launcher check ran with a synthetic Wine stub on Ubuntu 22.04 under WSL. ```powershell python -B tests/startup_run_ps1_check.py ctest --preset release --no-tests=error -R '^startup_native_graphics_draw_(hardware|warp)$' ctest --preset release --no-tests=error -R '^startup_xapu_(queue|opus|opus_count)$' cmake --preset release -B out/build/opus-archive-check -DCMAKE_DISABLE_FIND_PACKAGE_Opus=ON cmake --build out/build/opus-archive-check --target startup_xapu_queue_check startup_xapu_opus_check startup_xapu_opus_count_check ctest --test-dir out/build/opus-archive-check --no-tests=error -R '^startup_xapu_(queue|opus|opus_count)$' ``` ```bash python3 -B tests/startup_run_sh_check.py ``` - Both launcher suites passed. The PowerShell suite ran under Windows PowerShell and PowerShell 7. - The native graphics fixtures passed on WARP and hardware (2/2). - The XApu queue, Opus decode, and Opus counter fixtures passed with the installed package and with the source build (3/3 each). The clean build used the downloaded official archive staged in CMake's download cache. CMake checked the hash and built the static library. - Validation used source-built fixtures. Actual button audio and the prologue watchdog were outside this run.
Leyukaka commented 2026-11-29 11:20:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T11:20:03Z.

Review: COMMENTED


Diff and source reading only, nothing built or run. Read at 75db835a against main 20bd1553.

Configure-time download. X2W_WITH_OPUS now defaults to ${WIN32} (CMakeLists.txt:588). When find_package(Opus CONFIG QUIET) does not define Opus::opus, FetchContent downloads opus-1.5.2.tar.gz from downloads.xiph.org (CMakeLists.txt:590-601). The SHA-256 is the one already in src/startup_stubs/THIRD_PARTY_NOTICES.md:7-8. A default Windows configure without an installed Opus package therefore needs network access, or -DX2W_WITH_OPUS=OFF. The other FetchContent in the file (Tracy, CMakeLists.txt:621-637) is behind an option that defaults to OFF. Nothing under .github or in CMakePresets.json mentions Opus, so the Windows CI configure steps (windows.yml:468, 487, 602, 621) take the same path unless the runner provides a package.

X2W_NATIVE_SHADERS_ONLY is always overwritten. With -Render, both launchers set it to 1, or to 0 under -Translate / --translate (run.ps1:99-101, run.sh:176-178), whatever the caller exported. X2W_XAPU_TYPED_COMPLETIONS keeps a preset value (run.ps1:50, run.sh:107). With 1, the stand-in skips published manifests for graphics and compute (d3d12_draw.inl:480-483, d3d12_compute_dispatch.inl:130-133). So -Render -NativeShaders <dir>, which on main left the variable unset, now runs without the published-translation fallback; -Translate keeps the fallback and also starts the watcher.

Paths without a test case.

  • A preset X2W_XAPU_TYPED_COMPLETIONS=0 being kept: both suites remove the variable and expect 1 (startup_run_ps1_check.py:202, 290; startup_run_sh_check.py:307).
  • The missing-DLL error (run.ps1:94-98, run.sh:170-174): every -Render / --render case creates both DLLs.
  • The X2W_NATIVE_SHADERS environment override in either launcher, and the dxc.exe on PATH fallback (run.ps1:90-93, absent from run.sh): every such case writes x2w-dxc-dir.txt or passes -NativeShaders.
  • startup_run_sh returns 77 on Windows (startup_run_sh_check.py:474-476), so the run.sh changes are only exercised on a Linux host.

Docs that still describe the old defaults.

  • src/startup_stubs/THIRD_PARTY_NOTICES.md:5-6: "With the optional -DX2W_WITH_OPUS=ON configure option" and "link an installed libopus".
  • docs/startup-runtime.md:1009-1028: run.ps1 -Render -NativeShaders <dir> is described with "A refused key is left to the published translations"; that command now sets X2W_NATIVE_SHADERS_ONLY=1.
  • docs/startup-runtime.md:1678: the switches table marks X2W_NATIVE_SHADERS as experimental and has no row for X2W_NATIVE_SHADERS_ONLY (mentioned only at :961).
  • docs/startup-runtime.md:3234-3236 and :3242: "The experimental X2W_XAPU_TYPED_COMPLETIONS=1" and "the optional Opus decode".
  • docs/startup-runtime.md:3276 and docs/experiments/startup-opus-completion-count.md:47: the recipes still pass -DX2W_WITH_OPUS=ON -DOpus_DIR=... (still valid, no longer required on Windows).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6102638916 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3449#pullrequestreview-6102638916). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T11:20:03Z. **Review:** COMMENTED --- Diff and source reading only, nothing built or run. Read at 75db835a against main 20bd1553. **Configure-time download.** `X2W_WITH_OPUS` now defaults to `${WIN32}` (`CMakeLists.txt:588`). When `find_package(Opus CONFIG QUIET)` does not define `Opus::opus`, `FetchContent` downloads `opus-1.5.2.tar.gz` from downloads.xiph.org (`CMakeLists.txt:590-601`). The SHA-256 is the one already in `src/startup_stubs/THIRD_PARTY_NOTICES.md:7-8`. A default Windows configure without an installed Opus package therefore needs network access, or `-DX2W_WITH_OPUS=OFF`. The other `FetchContent` in the file (Tracy, `CMakeLists.txt:621-637`) is behind an option that defaults to OFF. Nothing under `.github` or in `CMakePresets.json` mentions Opus, so the Windows CI configure steps (`windows.yml:468`, `487`, `602`, `621`) take the same path unless the runner provides a package. **`X2W_NATIVE_SHADERS_ONLY` is always overwritten.** With `-Render`, both launchers set it to `1`, or to `0` under `-Translate` / `--translate` (`run.ps1:99-101`, `run.sh:176-178`), whatever the caller exported. `X2W_XAPU_TYPED_COMPLETIONS` keeps a preset value (`run.ps1:50`, `run.sh:107`). With `1`, the stand-in skips published manifests for graphics and compute (`d3d12_draw.inl:480-483`, `d3d12_compute_dispatch.inl:130-133`). So `-Render -NativeShaders <dir>`, which on main left the variable unset, now runs without the published-translation fallback; `-Translate` keeps the fallback and also starts the watcher. **Paths without a test case.** - A preset `X2W_XAPU_TYPED_COMPLETIONS=0` being kept: both suites remove the variable and expect `1` (`startup_run_ps1_check.py:202`, `290`; `startup_run_sh_check.py:307`). - The missing-DLL error (`run.ps1:94-98`, `run.sh:170-174`): every `-Render` / `--render` case creates both DLLs. - The `X2W_NATIVE_SHADERS` environment override in either launcher, and the `dxc.exe` on `PATH` fallback (`run.ps1:90-93`, absent from `run.sh`): every such case writes `x2w-dxc-dir.txt` or passes `-NativeShaders`. - `startup_run_sh` returns 77 on Windows (`startup_run_sh_check.py:474-476`), so the `run.sh` changes are only exercised on a Linux host. **Docs that still describe the old defaults.** - `src/startup_stubs/THIRD_PARTY_NOTICES.md:5-6`: "With the optional `-DX2W_WITH_OPUS=ON` configure option" and "link an installed libopus". - `docs/startup-runtime.md:1009-1028`: `run.ps1 -Render -NativeShaders <dir>` is described with "A refused key is left to the published translations"; that command now sets `X2W_NATIVE_SHADERS_ONLY=1`. - `docs/startup-runtime.md:1678`: the switches table marks `X2W_NATIVE_SHADERS` as experimental and has no row for `X2W_NATIVE_SHADERS_ONLY` (mentioned only at `:961`). - `docs/startup-runtime.md:3234-3236` and `:3242`: "The experimental `X2W_XAPU_TYPED_COMPLETIONS=1`" and "the optional Opus decode". - `docs/startup-runtime.md:3276` and `docs/experiments/startup-opus-completion-count.md:47`: the recipes still pass `-DX2W_WITH_OPUS=ON -DOpus_DIR=...` (still valid, no longer required on Windows).
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
R0Y00/Xbox2Windows!3449
No description provided.