Repository navigation
Conversation
The host removes the device for a constant buffer view of more than 65,536 bytes. The title's view heap holds larger sizes in slots it does not use, and the size went to the host as it was.
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-gpu— 51 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includingan_oversized_constant_buffer_view_leaves_the_device_alive)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok
Clean clamping of CBV SizeInBytes to the D3D12 64 KiB maximum so oversized CBVs do not trigger device removal. Looks good.
AI-assisted (Gemini 4 Neon).
|
In-title result for the cap, on an RTX 2080 (fxceless/victory-gta6
It is one session, so it shows that such a view does turn up in the title and that the device stays, not how often the old build would have ended. AI-assisted (Claude Code); counts and log lines only, nothing from the game attached. |
catminou4
left a comment
There was a problem hiding this comment.
Static review only: Windows-only code (D3D12/windows_sys/Win32/HLE) — nothing compiles or runs on macOS; source review of the diff.
CBV SizeInBytes is capped: constant_bytes = min(size, 64 KiB).next_multiple_of(256) — the host removes the device for larger views, and the title's heap holds such sizes in slots it does not use. The Windows test uses a real device and checks GetDeviceRemovedReason stays Ok across oversized views (969_472 and 896_256 bytes). Note the cap interacts with #1629's 256-byte padding — both compose since padding applies after the cap. Windows-only.
|
Closing this. Since today's push to The fix still matters on fxceless/victory-fork, which does create constant buffer views: fxceless/victory-fork#24. If a later change brings real CBVs back here, I'll reopen this. Thanks @DenRakEiw for the review and the testing. |
…pty ones, at most 64 KiB - Table CBVs filled into the list's scratch or own memory (upload fill or GPU copy) zero the bytes from the title's size to the 256-byte end the host view takes, as the console reads zeros past a view's size; before, they read what earlier recordings left there. A CBV copy is reused only where its bytes past the asked length are zeros. - A constant view of no address or no bytes is a null CBV (dynamic slots: HostHeap::null_constant; title slots: `make` declines it, `null_for` makes a null CBV), not a 0-byte view, a null 2D SRV, or a fill from title address 0. create_cbv without a description records View::Constant(0, 0) instead of leaving the slot's old view. - Host CBVs take at most 64 KiB (constant_bytes, capped_constant): larger ones remove the device on NVIDIA (0x887A0001). Title sizes over 64 KiB are logged (counted, with the largest seen), and only 64 KiB is copied. Tests (WARP): draw::tests::table_cbvs_read_zeros_past_their_size, descriptor::tests::a_constant_view_without_a_description_is_a_null_one, descriptor::host::tests::constant_views_are_capped_at_64_kib_and_null_when_empty. Ported from Marvisak/VIctory#1629 (head 111b773) by ESAT586 Ported from Marvisak/VIctory#1640 (head b916a9c) by NuraadGit Ported from fxceless/victory-fork#911 (1087538) by douline
A constant buffer view larger than 65,536 bytes removes the host device (
0x887A0001, "the application made a call that is invalid"). The size the title's descriptor holds went toCreateConstantBufferViewas it was, rounded up to 256. This caps it at 64 KiB, which is all a shader can index.Where such sizes come from. The title's view heap keeps old contents in slots it doesn't use, and the host makes a view for each. In two runs on an RTX 2080 that ended in
0x887A0001, the 64 views made just before the removal included constant buffer views of 969,472 and 896,256 bytes, at addresses that look like leftovers (0x7fe8…).Measured on an RTX 2080 (driver 616.56, Windows 11). One view per process, then
GetDeviceRemovedReason:Test.
an_oversized_constant_buffer_view_leaves_the_device_alivemakes both sizes throughmakeand one throughconstant_at, and checks the device after each. Without the cap it fails at the first one ("a view of 969472 bytes"); with it, it passes.cargo test -p victory-gpu --lib: 51 passed, 1 ignored.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean. Onffe310e.What this doesn't show.
mainin the title with and without this change.AI-assisted (Claude Code); counts and log lines only, nothing from the game attached.