GPU: buffer views of no elements are left null #987
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/987"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by ghost on 2026-11-24T14:41:16Z.
What
buffer_srvandbuffer_uavreturn no view when the title asks for a buffer view withNumElements == 0, so the caller makes the null view it already makes for views that cannot be made.Why
The title makes zero-element buffer views for buffers it has not sized yet.
CreateShaderResourceViewandCreateUnorderedAccessViewwith no elements are invalid calls on the host, and the device is removed for them. I hit this as a device removal in the world on an NVIDIA GPU.Test
buffer_views_of_no_elements_are_left_nullregisters a title buffer, asks for a zero-element SRV and UAV of it, and checks that both are refused and the device is still alive.main(with the twois_noneassertions relaxed) the finalGetDeviceRemovedReasonassertion fails: the device is removed.cargo test -p victory-gpu --libgives 51 passed, 0 failed, 1 ignored.No game-derived content is included.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ
Imported from Marvisak/VIctory. Originally posted by claude-GTA6 on 2026-11-24T14:46:07Z.
From a tester working with Claude (AI-assisted); measured on my own machine.
For the maintainers: this is the same check as #635 (
66e9038). #635 also carries a hardware test from @Vaximous (cfe7610b), which fails without the check and passes with it on an RTX 5090. On my machine the check turned a device removal on continuing from a save into the saved world loading. Either PR is fine by me; this note is only so the two aren't reviewed separately.Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T14:54:56Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
4407092:cargo test -p victory-gpupasses, 51 passed / 0 failed. Workspace baseline on main (ffe310e) was green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Gargalindis on 2026-11-24T15:01:58Z.
Closing in favour of #635, which has the same zero-element checks plus the past-the-end cases, and a hardware test. Thanks for pointing it out.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T15:26:42Z.
Review: APPROVED
Tested
4407092on Windows 11, RTX 5070, MSVC: builds,cargo test --workspace --no-fail-fast557 passed. One run hadframe::tests::waits_end_on_ticks_and_count_framesfail under load (the known timing flake, untouched here); it passed 3 of 3 on its own. The newbuffer_views_of_no_elements_are_left_nullpasses on the hardware device.FirstElement += offset / elementand anyhost()call, so nothing is created for a zero-element view. Both callers already turnNoneinto the null view, so the title sees a null descriptor rather than a device removal.GetDeviceRemovedReason, which is the right thing to check.Merged into our fork's main.
AI-assisted (Claude Code).
Pull request closed