gpu: test both D3D12 device struct-return argument orders #1099

Merged
Jess-Doit merged 2 commits from upstream-pr/1106 into main 2026-11-24 02:07:26 +00:00
Jess-Doit commented 2026-11-24 01:07:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T01:07:21Z.


Change

Refs #874.

Extend the source-built device fixture to call a GetCustomHeapProperties adapter in both argument orders. A third call seeds the stack return buffer with the live device's vtable pointer. The adapter identifies the device by its known address and forwards to the desktop SDK method. The fixture checks the return pointer, all five result words, and both guards. The adapter is linked into the fixture for this check.

Scope: this is a test fixture, not a fix. src/d3d12x_struct_return.{h,cpp} is linked only into d3d12x_device_check; nothing in the d3d12_xs shim calls it yet, and the shim has no struct-return handling today. The fixture pins down the expected result for both argument orders (including a return buffer that starts with the device's vtable pointer) so a later shim change can be checked against it.

Verification

Tested d15536fd (rebased on ea0e838e) on Windows 10 22H2 19045.6456 with a GTX 1060 6GB (32.0.15.6094) and in-box WARP (10.0.19041.5794). The D3D12 debug layer was enabled on both adapters.

. .\tools\dev.ps1
$env:XBOX2WINDOWS_ADAPTER = '1060'
$filter = '^d3d12x_device_(struct_return|create|negative)_(warp|hardware)$'
foreach ($preset in 'dev', 'release') {
    cmake --preset $preset
    cmake --build --preset $preset --target d3d12x_device_check -j 2
    ctest --preset $preset --no-tests=error -R $filter -V
}

Each preset passed 6/6 with zero skips. With return-buffer-first handling removed, the matching test failed on both adapters at the return-buffer-first case. A second mutation that refused matching vtable words failed on both adapters at the seeded case while both unseeded calls passed. Both mutations left the four existing device tests passing in each preset. Restoring the adapter returned both runs to 6/6.

The mutation runs were on the pre-rebase commit 4dc16791 (base a4e2e47c); main's newer commits overlap this PR only in CMakeLists.txt and docs/experiments.md, with no conflicts, and the rebased commit passed 6/6 again in both presets.

AI-assisted (Codex, reviewed with Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572256798 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1106). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-24T01:07:21Z. --- ## Change Refs #874. Extend the source-built device fixture to call a `GetCustomHeapProperties` adapter in both argument orders. A third call seeds the stack return buffer with the live device's vtable pointer. The adapter identifies the device by its known address and forwards to the desktop SDK method. The fixture checks the return pointer, all five result words, and both guards. The adapter is linked into the fixture for this check. **Scope:** this is a test fixture, not a fix. `src/d3d12x_struct_return.{h,cpp}` is linked only into `d3d12x_device_check`; nothing in the `d3d12_xs` shim calls it yet, and the shim has no struct-return handling today. The fixture pins down the expected result for both argument orders (including a return buffer that starts with the device's vtable pointer) so a later shim change can be checked against it. ## Verification Tested `d15536fd` (rebased on `ea0e838e`) on Windows 10 22H2 `19045.6456` with a GTX 1060 6GB (`32.0.15.6094`) and in-box WARP (`10.0.19041.5794`). The D3D12 debug layer was enabled on both adapters. ```powershell . .\tools\dev.ps1 $env:XBOX2WINDOWS_ADAPTER = '1060' $filter = '^d3d12x_device_(struct_return|create|negative)_(warp|hardware)$' foreach ($preset in 'dev', 'release') { cmake --preset $preset cmake --build --preset $preset --target d3d12x_device_check -j 2 ctest --preset $preset --no-tests=error -R $filter -V } ``` Each preset passed 6/6 with zero skips. With return-buffer-first handling removed, the matching test failed on both adapters at the return-buffer-first case. A second mutation that refused matching vtable words failed on both adapters at the seeded case while both unseeded calls passed. Both mutations left the four existing device tests passing in each preset. Restoring the adapter returned both runs to 6/6. The mutation runs were on the pre-rebase commit `4dc16791` (base `a4e2e47c`); main's newer commits overlap this PR only in `CMakeLists.txt` and `docs/experiments.md`, with no conflicts, and the rebased commit passed 6/6 again in both presets. AI-assisted (Codex, reviewed with Claude Code).
upstream-sync closed this pull request 2026-11-24 06:46:21 +00:00
Toons29 commented 2026-11-24 06:50:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Toons29 on 2026-11-24T02:02:51Z.


Tested 8d4767bc on an AMD Radeon RX 9070 (RDNA 4, 1002:7550), driver 32.0.32029.2010, Windows 11 build 26300, dev preset, debug layer unavailable: pass

ctest --preset dev --no-tests=error -R '^d3d12x_device_' -V

All 6 pass with no skips: create, negative and the new struct_return on both hardware and in-box WARP. The negative case reports null_device=E_POINTER unknown_iid=0x80004002 output=null.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119701916 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1106#issuecomment-7119701916). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-24T02:02:51Z. --- Tested 8d4767bc on an AMD Radeon RX 9070 (RDNA 4, `1002:7550`), driver `32.0.32029.2010`, Windows 11 build 26300, `dev` preset, debug layer unavailable: pass ```powershell ctest --preset dev --no-tests=error -R '^d3d12x_device_' -V ``` All 6 pass with no skips: `create`, `negative` and the new `struct_return` on both hardware and in-box WARP. The negative case reports `null_device=E_POINTER unknown_iid=0x80004002 output=null`.
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!1099
No description provided.