Fix D3D12 device removal on oversized constant buffer views #28

Merged
GAD15 merged 1 commit from upstream-pr/28 into main 2026-11-25 16:49:14 +00:00
GAD15 commented 2026-11-25 15:57:52 +00:00 (Migrated from github.com)

Imported from uiliannn/VItoriaBr. Originally posted by GAD15 on 2026-11-25T15:57:52Z.


On Windows 11 with an RTX 4060 Ti 8 GB, the release build reached the opening scene and then lost the D3D12 device with DXGI_ERROR_INVALID_CALL. The descriptor batch logged immediately before removal included a constant buffer view of 1,087,744 bytes. D3D12 allows a shader to address at most 64 KiB through a CBV.

This change caps the range used to mirror a constant buffer and the range copied into a dynamic descriptor table. It keeps the 256-byte host alignment and handles empty and null-address views without copying from them.

I rebuilt the release and ran the same game files on the same PC. The opening scene rendered past the point of the original device removal. The targeted regression test passed on Windows using the descriptor size from the failing run.

cargo test --release --locked -p victory-gpu --lib constant_view_from_world_load_fits_the_device

Related upstream report: Marvisak/VIctory#1640.

<!-- greyfinch-sync:uiliannn/VItoriaBr:issue:6608435786 --> Imported from [uiliannn/VItoriaBr](https://github.com/uiliannn/VItoriaBr/pull/28). Originally posted by [GAD15](https://github.com/GAD15) on 2026-11-25T15:57:52Z. --- On Windows 11 with an RTX 4060 Ti 8 GB, the release build reached the opening scene and then lost the D3D12 device with `DXGI_ERROR_INVALID_CALL`. The descriptor batch logged immediately before removal included a constant buffer view of 1,087,744 bytes. D3D12 allows a shader to address at most 64 KiB through a CBV. This change caps the range used to mirror a constant buffer and the range copied into a dynamic descriptor table. It keeps the 256-byte host alignment and handles empty and null-address views without copying from them. I rebuilt the release and ran the same game files on the same PC. The opening scene rendered past the point of the original device removal. The targeted regression test passed on Windows using the descriptor size from the failing run. `cargo test --release --locked -p victory-gpu --lib constant_view_from_world_load_fits_the_device` Related upstream report: Marvisak/VIctory#1640.
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
uiliannn/VItoriaBr!28
No description provided.