gpu: preserve raw BC64 console layout words #2226

Manually merged
github merged 1 commit from gh-pr/2226/head into gh-pr/2226/base 2026-11-27 00:07:31 +00:00
Owner

@⁠chadhyatt on GitHub · 2026-11-25 06:16 UTC · original
chadhyatt:backport/console-layout-fixture-words → main · +15 −4 · 2 files · 1 commits · merged 2026-11-25 06:30 UTC

The BC64 source-built fixture fails to compile with Clang because constexpr static_cast<D3D12_TEXTURE_LAYOUT>(0x109) evaluates a value outside the enum range [0,3]. Treat the guest ABI field as a raw UINT on both the fixture construction and BC64 predicate read. Accepted shapes and negative controls are unchanged; other layout readers are outside this narrow correction.

Base: 7a1824d4. Tested head: 452dc48a (Apple Silicon macOS, Homebrew LLVM and MinGW-w64). Before: clang++ --target=x86_64-w64-windows-gnu --sysroot=/opt/homebrew/opt/mingw-w64/toolchain-x86_64 -std=c++17 -fsyntax-only -Isrc tests/startup_bc64_supports_check.cpp fails at line 19 with integer value 265 outside [0,3]. After: same target/sysroot with -std=c++17 -O2 -Wall -Wextra -Isrc -c tests/startup_bc64_supports_check.cpp -o out/backport-fixture/bc64-clang.o succeeds; x86_64-w64-mingw32-g++ -std=c++17 -O2 -Wall -Wextra -Isrc tests/startup_bc64_supports_check.cpp -o out/backport-fixture/bc64-gcc.exe succeeds. Windows CTest execution not available locally; expected checks ctest --preset release --no-tests=error -R "^startup_bc64_supports" -V including existing layout mutation. Related #1557 and #1690.

AI-assisted backport patch from x2w-microlift.

**@⁠chadhyatt** on GitHub · 2026-11-25 06:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2226) `chadhyatt:backport/console-layout-fixture-words` → `main` · +15 −4 · 2 files · 1 commits · merged 2026-11-25 06:30 UTC The BC64 source-built fixture fails to compile with Clang because `constexpr static_cast<D3D12_TEXTURE_LAYOUT>(0x109)` evaluates a value outside the enum range [0,3]. Treat the guest ABI field as a raw UINT on both the fixture construction and BC64 predicate read. Accepted shapes and negative controls are unchanged; other layout readers are outside this narrow correction. Base: 7a1824d4. Tested head: 452dc48a (Apple Silicon macOS, Homebrew LLVM and MinGW-w64). Before: `clang++ --target=x86_64-w64-windows-gnu --sysroot=/opt/homebrew/opt/mingw-w64/toolchain-x86_64 -std=c++17 -fsyntax-only -Isrc tests/startup_bc64_supports_check.cpp` fails at line 19 with integer value 265 outside [0,3]. After: same target/sysroot with `-std=c++17 -O2 -Wall -Wextra -Isrc -c tests/startup_bc64_supports_check.cpp -o out/backport-fixture/bc64-clang.o` succeeds; `x86_64-w64-mingw32-g++ -std=c++17 -O2 -Wall -Wextra -Isrc tests/startup_bc64_supports_check.cpp -o out/backport-fixture/bc64-gcc.exe` succeeds. Windows CTest execution not available locally; expected checks `ctest --preset release --no-tests=error -R "^startup_bc64_supports" -V` including existing layout mutation. Related #1557 and #1690. AI-assisted backport patch from x2w-microlift.
- Read the guest layout object representation as UINT rather than evaluating an invalid desktop enum.
- Construct the fixture with the exact raw layout word, avoiding an invalid constant expression.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:07:30 +00:00
github manually merged commit 452dc48a2e into gh-pr/2226/base 2026-11-27 00:07:31 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 06:17 UTC · original · reviewed

Review of head 452dc48a2ede6424333da237b80a58a19236c560 (comment only).

Summary: The change is small and correct. It reads and writes the guest layout field as a raw 32-bit word (memcpy) instead of casting an out-of-range value into the enum. That removes the Clang constexpr error and keeps the accepted shapes and negative controls the same.

Findings

  • P1: none.
  • P2: none.
  • nit: guest_layout_word is only used in bc64_chain.h. single_element_srv.h and gfx10_layout.h read the layout the same way (0x109 family), so they could share it later. The PR says that is out of scope, which is fine.
  • nit: the PR body says Windows CTest was not run. Please wait for the CI "Build and test on Windows" job (pending when I checked) before merging.

Checks run locally (Linux worktree at the head SHA)

  • git diff --check origin/main...HEAD -> clean
  • python3 tests/docs_links_check.py -> pass (18 files, 412 links)
  • python3 tests/bidi_controls_check.py -> pass (no bidi controls)
  • x86_64-w64-mingw32-g++ -std=c++17 -O2 -Wall -Wextra -Isrc tests/startup_bc64_supports_check.cpp -> builds with no warnings
  • Run under wine: "bc64 supports: 10 of 26 descriptions accepted, the rest rejected" (pass)
  • Mutation: changed guest_layout_word(d) == 0x109 to 0x10A in bc64_chain.h, rebuilt, ran. The test fails ("FAIL nine BC7 ...: rejected, expected accepted"), so the check catches a wrong layout word. Reverted with git checkout -- ..
  • Not run: Win2025 WARP. This is a host-side predicate and fixture change with no shader or GPU effect, so it is not needed.

Other: the PR is MERGEABLE, the title is neutral, and I saw nothing clean-room related in the diff. At review time the Linux Python check had passed and the Windows jobs were pending.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 06:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2226#pullrequestreview-6052734950) · **reviewed** Review of head `452dc48a2ede6424333da237b80a58a19236c560` (comment only). Summary: The change is small and correct. It reads and writes the guest layout field as a raw 32-bit word (`memcpy`) instead of casting an out-of-range value into the enum. That removes the Clang constexpr error and keeps the accepted shapes and negative controls the same. Findings - P1: none. - P2: none. - nit: `guest_layout_word` is only used in `bc64_chain.h`. `single_element_srv.h` and `gfx10_layout.h` read the layout the same way (`0x109` family), so they could share it later. The PR says that is out of scope, which is fine. - nit: the PR body says Windows CTest was not run. Please wait for the CI "Build and test on Windows" job (pending when I checked) before merging. Checks run locally (Linux worktree at the head SHA) - `git diff --check origin/main...HEAD` -> clean - `python3 tests/docs_links_check.py` -> pass (18 files, 412 links) - `python3 tests/bidi_controls_check.py` -> pass (no bidi controls) - `x86_64-w64-mingw32-g++ -std=c++17 -O2 -Wall -Wextra -Isrc tests/startup_bc64_supports_check.cpp` -> builds with no warnings - Run under wine: "bc64 supports: 10 of 26 descriptions accepted, the rest rejected" (pass) - Mutation: changed `guest_layout_word(d) == 0x109` to `0x10A` in `bc64_chain.h`, rebuilt, ran. The test fails ("FAIL nine BC7 ...: rejected, expected accepted"), so the check catches a wrong layout word. Reverted with `git checkout -- .`. - Not run: Win2025 WARP. This is a host-side predicate and fixture change with no shader or GPU effect, so it is not needed. Other: the PR is MERGEABLE, the title is neutral, and I saw nothing clean-room related in the diff. At review time the Linux Python check had passed and the Windows jobs were pending. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.