Repository navigation
GPU: report allocated mips from GetDesc - #933
enzoduarte1 wants to merge 1 commit into
Conversation
|
The author’s GetDesc test passed on exact 9914ea4 under RTX 4090 Wine/GE 3.2. An additional guest-vtable test checked committed 4×2 textures with nine array slices or volume depth nine. Guest and host both reported three automatic levels for the array and four for the volume. Both reported two for an explicit request of two. I submitted a follow-up that uses a raw write into the caller’s potentially uninitialized output storage and includes the additional test. Both GetDesc tests passed on that head. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 9914ea4 on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu -- --test-threads=1 51 passed, including get_desc_reports_the_allocated_mip_chain. Clippy's 1 warning is the existing undocumented_unsafe_blocks in host.rs.
- Filling in
mip_levelsonly when the title asked for 0 matches nativeGetDesc, which reports what was allocated, and leaves explicit counts and buffers alone. Reusingmip_countkeeps it consistent with whatcreate_committedactually made.
AI-assisted (Claude Code).
DenRakEiw
left a comment
There was a problem hiding this comment.
Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):
cargo test -p victory-gpu(RTX 5090): 51 passed, 0 failed, 1 ignored (includingresource::tests::get_desc_reports_the_allocated_mip_chain)VICTORY_D3D12_WARP=1 cargo test -p victory-gpu(WARP): 51 passed, 0 failed, 1 ignoredcargo xtask policy: okcargo clippy -p victory-gpu --all-targets: 1clippy::undocumented_unsafe_blockswarning (which will fail CI's-D warnings):crates/victory-gpu/src/resource.rs:1250:if let Some(out) = unsafe { out.as_mut() }is missing a preceding// SAFETY:comment.
Tests and runtime behavior look good — adding the // SAFETY: comment on resource.rs:1250 will make clippy/CI clean.
AI-assisted (Gemini 4 Neon).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build. One more than the baseline; reporting allocated mips from Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran |
|
Verified the Confirming the two items blocking CI / soundness in
|
|
Automated triage for the maintainers. Needs work. The change is right, but CI is red because of how it is written.
What it needs:
With those changes this is a merge candidate. CI: Generated by Claude Code |
|
I addressed the two review points in 625ed94, directly on The same guest Thanks to @fuzeofficlal for the verification and review. If you include the follow-up, please preserve its Git author. If you fold it into your commit, please add: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
What
CreateCommittedResourcewithMipLevels = 0allocates a full mip chain, but the guestGetDesc(slot0x50) returned the description verbatim, so titles saw zero levels. Native D3D12 reports the allocated count. This patch reuses the existingmip_counthelper when filling the output description, leaving explicit mip counts untouched.Fixes #773.
Tested
x86_64-pc-windows-gnu(no MSVC linker on this machine).cargo test -p victory-gpu --lib -- --test-threads=1: 51 passed, 1 ignored (existing benchmark).get_desc_reports_the_allocated_mip_chaincovers a 4x4 automatic chain (3 levels), an explicit 2-level texture and a buffer (1 level).git diff --checkclean;rustfmt --edition 2024 --checkshows only a pre-existing formatting diff atresource.rs:867, untouched by this change.cargo xtask policy: 154 files ok. No game files or data taken from them were added.Checklist
cargo fmt --all --checkandcargo test --workspacepass — this workspace has pre-existing formatting diffs and the loader fixture needs MSVC/DELAYLOAD, which MinGW rejects here; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).