GPU: give the root signature test the host's root parameter layout #95

Closed
martingouv wants to merge 1 commit from upstream-pr/95 into main
martingouv commented 2026-11-24 00:26:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by martingouv on 2026-11-24T00:26:27Z.


root::tests::host_serialized_blobs_create_root_signatures fails on a clean main (35b054e) on my machine with E_INVALIDARG from serialize.

Cause

The test built D3D12_ROOT_PARAMETER by hand as five packed u32s (20 bytes). The host's struct is 32 bytes: the union is 8-aligned (its descriptor-table arm holds a pointer), so it sits at offset 8, and ShaderVisibility at offset 24. The host therefore read register space 1, zero constants, and a visibility from 4 bytes past the end of the struct, so the test passed or failed depending on what was on the stack.

Fix

Use the windows crate's D3D12_ROOT_PARAMETER in the test. The test only; no runtime code changes.

Tested

cargo test --workspace passes on Windows 11, RTX 5060 Ti, NVIDIA driver 621.24 (the failure is a CPU-side serialization issue, not driver-specific). No game files involved.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6571758555 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/95). Originally posted by [martingouv](https://github.com/martingouv) on 2026-11-24T00:26:27Z. --- `root::tests::host_serialized_blobs_create_root_signatures` fails on a clean `main` (35b054e) on my machine with `E_INVALIDARG` from `serialize`. ## Cause The test built `D3D12_ROOT_PARAMETER` by hand as five packed `u32`s (20 bytes). The host's struct is 32 bytes: the union is 8-aligned (its descriptor-table arm holds a pointer), so it sits at offset 8, and `ShaderVisibility` at offset 24. The host therefore read register space 1, zero constants, and a visibility from 4 bytes past the end of the struct, so the test passed or failed depending on what was on the stack. ## Fix Use the `windows` crate's `D3D12_ROOT_PARAMETER` in the test. The test only; no runtime code changes. ## Tested `cargo test --workspace` passes on Windows 11, RTX 5060 Ti, NVIDIA driver 621.24 (the failure is a CPU-side serialization issue, not driver-specific). No game files involved. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 06:51:17 +00:00
lordon1a commented 2026-11-24 06:54:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:40:10Z.


Verified f0d41db41 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@35b054ec0): pass (cargo xtask policy: 150 files ok; cargo test -p victory-gpu: 39 passed, 0 failed).

Heads-up: this makes the exact same change to crates/victory-gpu/src/root.rs as earlier open PR #36 (apart from the one-line comment). AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118308858 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/95#issuecomment-7118308858). Originally posted by [lordon1a](https://github.com/lordon1a) on 2026-11-24T00:40:10Z. --- Verified `f0d41db41` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@35b054ec0`): **pass** (`cargo xtask policy`: 150 files ok; `cargo test -p victory-gpu`: **39 passed, 0 failed**). Heads-up: this makes the exact same change to `crates/victory-gpu/src/root.rs` as earlier open PR #36 (apart from the one-line comment). AI-assisted.
martingouv commented 2026-11-24 06:54:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by martingouv on 2026-11-24T00:46:46Z.


Superseded by #36, which landed first with the same fix. Thanks for the heads-up.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118423697 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/95#issuecomment-7118423697). Originally posted by [martingouv](https://github.com/martingouv) on 2026-11-24T00:46:46Z. --- Superseded by #36, which landed first with the same fix. Thanks for the heads-up.
DaviTostes commented 2026-11-24 06:54:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:50:32Z.


Tested f0d41db under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with cargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.

  • victory_gpu: 36 passed, 3 failed; the three failures are the environment-only ones from main (argument_clamp_builds, a_rejected_blob_gives_an_empty_library, #128's VirtualQuery upload skip).
  • root::tests::host_serialized_blobs_create_root_signatures is ok here both before and after this change: vkd3d-proton accepts the malformed 20-byte parameter blob, so this environment cannot reproduce the E_INVALIDARG you see on Windows. The layout fix is still right; the failing case apparently needs a real driver's blob validation.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118489756 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/95#issuecomment-7118489756). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T00:50:32Z. --- Tested `f0d41db` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with `cargo xwin ... --target x86_64-pc-windows-msvc`: **pass, no regression**. - `victory_gpu`: **36 passed, 3 failed**; the three failures are the environment-only ones from `main` (`argument_clamp_builds`, `a_rejected_blob_gives_an_empty_library`, #128's `VirtualQuery` upload skip). - `root::tests::host_serialized_blobs_create_root_signatures` is **ok here both before and after** this change: vkd3d-proton accepts the malformed 20-byte parameter blob, so this environment cannot reproduce the `E_INVALIDARG` you see on Windows. The layout fix is still right; the failing case apparently needs a real driver's blob validation. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

Pull request closed

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
Marvisak/VIctory!95
No description provided.