startup: upload luma and chroma from single-image NV12 textures #1177

Manually merged
github merged 1 commit from gh-pr/1177/head into gh-pr/1177/base 2026-11-26 22:46:29 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 02:33 UTC · original
R0Y00:codex/nv12-startup-texture → main · +376 −62 · 7 files · 1 commits · merged 2026-11-24 04:20 UTC

Refs #1138. Depends on #1135. The temporary review base keeps this diff to one commit. Retarget to main after #1135 lands.

The source-built 8×4 reproduction against e658fe24 got a one-plane layout, S_OK for Y, and E_INVALIDARG for UV. The desktop draw uploader only copied the first plane. Both paths now use the same two desktop footprints for a single-mip, single-sample NV12 texture. A rejected array probe and short UV row return errors. The original video's texture format is still unknown.

The regression writes both planes via the startup XG interface and uses the draw uploader's copy helper. A source-built pixel shader reads R8 and R8G8 views, converts the two planes to RGBA, and checks every pixel against the CPU. The U/V-swapped control produces 32 distinct-from-baseline pixel values per run.

Verified commit 7dcdfdc, first Release configure with the default intake Python location, Windows 11 build 26200.9974, debug layer off. NVIDIA RTX 4060 Laptop 32.0.16.1656 and Microsoft WARP 10.0.26100.9818 each matched all 32 pixels in both cases.

python -m venv --without-pip out/pe-env
.\tools\dev.ps1
cmake --preset release -DCMAKE_TRY_COMPILE_CONFIGURATION=Release
cmake --build --preset release --target startup_nv12_draw d3d12_xs_shim startup_stub_consumer startup_stub_gameinput startup_stub_acphal startup_stub_xapu startup_stub_xcrdapi
ctest --preset release --no-tests=error -R '^startup_(nv12_draw_.*|stubs)$' -V

Result: 3/3 passed, 0 skips. The first-configure startup_stubs command used out/pe-env/Scripts/python.exe. The two NV12 tests invoke the compiled fixture directly.

**@⁠R0Y00** on GitHub · 2026-11-24 02:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1177) `R0Y00:codex/nv12-startup-texture` → `main` · +376 −62 · 7 files · 1 commits · merged 2026-11-24 04:20 UTC Refs #1138. Depends on #1135. The temporary review base keeps this diff to one commit. Retarget to `main` after #1135 lands. The source-built 8×4 reproduction against `e658fe24` got a one-plane layout, `S_OK` for Y, and `E_INVALIDARG` for UV. The desktop draw uploader only copied the first plane. Both paths now use the same two desktop footprints for a single-mip, single-sample NV12 texture. A rejected array probe and short UV row return errors. The original video's texture format is still unknown. The regression writes both planes via the startup XG interface and uses the draw uploader's copy helper. A source-built pixel shader reads R8 and R8G8 views, converts the two planes to RGBA, and checks every pixel against the CPU. The U/V-swapped control produces 32 distinct-from-baseline pixel values per run. Verified commit `7dcdfdc`, first Release configure with the default intake Python location, Windows 11 build 26200.9974, debug layer off. NVIDIA RTX 4060 Laptop 32.0.16.1656 and Microsoft WARP 10.0.26100.9818 each matched all 32 pixels in both cases. ```powershell python -m venv --without-pip out/pe-env .\tools\dev.ps1 cmake --preset release -DCMAKE_TRY_COMPILE_CONFIGURATION=Release cmake --build --preset release --target startup_nv12_draw d3d12_xs_shim startup_stub_consumer startup_stub_gameinput startup_stub_acphal startup_stub_xapu startup_stub_xcrdapi ctest --preset release --no-tests=error -R '^startup_(nv12_draw_.*|stubs)$' -V ``` Result: 3/3 passed, 0 skips. The first-configure `startup_stubs` command used `out/pe-env/Scripts/python.exe`. The two NV12 tests invoke the compiled fixture directly.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:46:27 +00:00
github manually merged commit a25fb55f37 into gh-pr/1177/base 2026-11-26 22:46:29 +00:00
Author
Owner

@⁠denn0x on GitHub · 2026-11-24 03:30 UTC · original

Test report for 7dcdfdcd: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off.

  • cmake --build out/build/release: built with no errors or failures.
  • ctest --no-tests=error -R startup: 7/7 passed, 0 failed, no skips.

Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved.

AI-assisted (Claude Code).

**@⁠denn0x** on GitHub · 2026-11-24 03:30 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1177#issuecomment-7121164007) Test report for `7dcdfdcd`: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off. - `cmake --build out/build/release`: built with no errors or failures. - `ctest --no-tests=error -R startup`: 7/7 passed, 0 failed, no skips. Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved. AI-assisted (Claude Code).
Author
Owner

@⁠lambirou on GitHub · 2026-11-24 04:23 UTC · original

Independent retarget check: the #1177 diff applies cleanly to main at b5cb8800 in a fresh worktree. The worktree builds in Release with Windows 10.0.26300.10075 and MSVC 19.44.35228.0.

ctest --preset release --no-tests=error -R '^startup_(nv12_draw_.*|stubs)$' -V

  • startup_nv12_draw_warp: passed on WARP (Microsoft Basic Render Driver). UV and VU both matched all 32 pixels, 0 mismatches.
  • startup_nv12_draw_hardware: passed on AMD Radeon RX 9060 XT 32.0.32029.2010. UV and VU both matched all 32 pixels, 0 mismatches.
  • startup_stubs: passed.
  • 3/3 passed, 0 failed, 0 skips.

The PR still targets codex/pr1135-review-base (5691fe81), so it has no CI against main. Please retarget/rebase it to main; the local apply was clean. Note that #1174 touches the same four files (CMakeLists.txt, docs/startup-runtime.md, d3d12_draw.inl, d3d12_xs_device.cpp), so merge one and rebase the other.

No game files, dumps or private logs were used. AI-assisted (Codex).

**@⁠lambirou** on GitHub · 2026-11-24 04:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1177#issuecomment-7121976078) Independent retarget check: the #1177 diff applies cleanly to `main` at `b5cb8800` in a fresh worktree. The worktree builds in Release with Windows 10.0.26300.10075 and MSVC 19.44.35228.0. `ctest --preset release --no-tests=error -R '^startup_(nv12_draw_.*|stubs)$' -V` - `startup_nv12_draw_warp`: passed on WARP (Microsoft Basic Render Driver). UV and VU both matched all 32 pixels, 0 mismatches. - `startup_nv12_draw_hardware`: passed on AMD Radeon RX 9060 XT 32.0.32029.2010. UV and VU both matched all 32 pixels, 0 mismatches. - `startup_stubs`: passed. - 3/3 passed, 0 failed, 0 skips. The PR still targets `codex/pr1135-review-base` (`5691fe81`), so it has no CI against `main`. Please retarget/rebase it to `main`; the local apply was clean. Note that #1174 touches the same four files (`CMakeLists.txt`, `docs/startup-runtime.md`, `d3d12_draw.inl`, `d3d12_xs_device.cpp`), so merge one and rebase the other. No game files, dumps or private logs were used. AI-assisted (Codex).
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 02:40 UTC · original · reviewed

Reviewed at commit 7dcdfdcd71c8747d4fe52089f5680f1cc6933350.

  • Code notes: src/startup_stubs/slice_footprints.h shares single-image even-dimension 2D NV12 footprint calculation and D3D12 subresource indexing (m + slice * mips + p * slices * mips) between xg_xs.cpp and d3d12_draw.inl, with upload_texture deferring state.done = true until all planes copy and XGCreateTextureComputer returning E_NOTIMPL for unsupported NV12 shapes (arrays/mips/odd sizes). tests/startup_nv12_draw.cpp verifies both UV and VU-swapped controls against CPU YCbCr math.
  • Linux checks passed:
    • python3 tests/docs_links_check.py (253 links across 16 Markdown files)
    • python3 tests/bidi_controls_check.py (967 files)
    • python3 tests/gpu_report_format_check.py (10 tests)
    • python3 tests/xgameruntime_table_check.py
  • Not run on Linux: Windows MSVC build and startup_nv12_draw_{warp,hardware} CTest runs (no CI checks reported on this branch yet; those rely on Windows/CI).
**@⁠tedin7** on GitHub · 2026-11-24 02:40 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1177#pullrequestreview-6032872047) · **reviewed** Reviewed at commit `7dcdfdcd71c8747d4fe52089f5680f1cc6933350`. - **Code notes**: `src/startup_stubs/slice_footprints.h` shares single-image even-dimension 2D NV12 footprint calculation and D3D12 subresource indexing (`m + slice * mips + p * slices * mips`) between `xg_xs.cpp` and `d3d12_draw.inl`, with `upload_texture` deferring `state.done = true` until all planes copy and `XGCreateTextureComputer` returning `E_NOTIMPL` for unsupported NV12 shapes (arrays/mips/odd sizes). `tests/startup_nv12_draw.cpp` verifies both `UV` and `VU`-swapped controls against CPU YCbCr math. - **Linux checks passed**: - `python3 tests/docs_links_check.py` (253 links across 16 Markdown files) - `python3 tests/bidi_controls_check.py` (967 files) - `python3 tests/gpu_report_format_check.py` (10 tests) - `python3 tests/xgameruntime_table_check.py` - **Not run on Linux**: Windows MSVC build and `startup_nv12_draw_{warp,hardware}` CTest runs (no CI checks reported on this branch yet; those rely on Windows/CI).
This discussion has been locked. Commenting is limited to contributors.
No description provided.