Skip to content

GPU: build and test the D3D12 crate off Windows - #120

Open
lordra9-svg wants to merge 1 commit into
DexNom:mainfrom
lordra9-svg:linux/gpu-check
Open

lordra9-svg wants to merge 1 commit into
DexNom:mainfrom
lordra9-svg:linux/gpu-check

Conversation

@lordra9-svg

Copy link
Copy Markdown

Why this PR exists

#93 gets the inherited CPU crates building on Linux and leaves one design call open: victory-gpu still does not compile off Windows because two functions in non-Windows code call cfg(windows) host/texture helpers. This takes the smallest option it lists — gate those two functions — so the D3D12 crate and victory-game behind it type-check and their CPU tests run on Linux. The Windows build is unchanged.

What changes

  • crates/victory-gpu/src/list.rs, ValueWait::holds: the existing body (the kernel read through host::read_into, with the optional texture::committed pre-check) is now cfg(windows). The cfg(not(windows)) body returns true: there is no guest memory to read, so nothing can be waiting on it in a check-only build.
  • crates/victory-gpu/src/resource.rs, view_format: the existing body (asks the host resource's GetDesc) is now cfg(windows). Off Windows it returns None: no host copies are made, so no view needs the title format.
  • crates/victory-gpu/src/lib.rs: off Windows, allow dead_code, unused_imports, unused_mut and unused_variables. The cfg(windows) host paths leave their helpers and parameters unused there; Windows keeps the workspace lints as they are.

Testing

Machine: AMD Ryzen 7 7700 (8c/16t), 30 GiB, Bazzite, kernel 7.3.5, rustc 1.98.1 from rust-toolchain.toml. BCPack tables from the pinned upstream blob, sha256 1f1d4760419202bb5672f0c428ce51e456b5d08fbaec8f371d043fd94e01c36b. No game data.

cargo test --locked --no-fail-fast -p victory-core -p victory-formats -p victory-pipeline -p victory-shader -p victory-gpu -p victory-game

Crate Result
victory-core 12 passed
victory-formats 26 passed, 4 ignored
victory-game 14 passed
victory-gpu 26 passed
victory-pipeline 4 passed
victory-shader 182 passed, 2 ignored
Total 264 passed, 0 failed, 6 ignored

Not tested

No D3D12 device, GPU execution or gameplay: this is a Linux machine without a Windows graphics path. The new bodies are never reached by the Windows runtime.

AI use

The patch, the test runs and this description were produced by an OpenCode agent running DeepSeek V4.1 Flash. Submitted from @lordra9-svg's account.

ValueWait::holds reads guest memory through cfg(windows) host/texture helpers and
resource::view_format asks the host resource for its description. Give both a
cfg(not(windows)) body (there is no guest memory to read and no host copy to ask
about) so the crate type-checks elsewhere; the Windows bodies are unchanged.

The cfg(windows) host paths leave helpers and parameters unused off Windows, so
allow those lints there only.

victory-gpu (26 tests) and victory-game (14) now build and run natively on Linux.
victory-hle still needs victory-loader's crash module gated (see DexNom#93).
@andrewDoing

Copy link
Copy Markdown

Independent native Windows MSVC diagnostics check at ee92148 on a verified RTX 5070: ValueWait::met matched independent comparisons in 288 real mapped-memory cases across both VICTORY_WAIT_ASK settings, three values, three references around 2^32, both 32/64-bit widths and all eight comparison codes. A null texture produced no format override; a real RGBA8 guest/host 28/28 returned None, and real D32 guest/host 40/39 returned Some(40). Both tests passed in both processes. This complements the cross-build evidence; gameplay was not tested.

Verification was AI-assisted with GPT-6.2 Astra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants