Fix D3D12 device removal on oversized constant buffer views #28

Manually merged
github merged 1 commit from gh-pr/28/head into gh-pr/28/base 2026-11-26 03:41:31 +00:00
Owner

@⁠GAD15 on GitHub · 2026-11-25 15:57 UTC · original
GAD15:fix/constant-buffer-view-limit → main · +27 −1 · 2 files · 1 commits · merged 2026-11-25 16:49 UTC

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.

**@⁠GAD15** on GitHub · 2026-11-25 15:57 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/28) `GAD15:fix/constant-buffer-view-limit` → `main` · +27 −1 · 2 files · 1 commits · merged 2026-11-25 16:49 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:41:30 +00:00
github manually merged commit adddacb92d into gh-pr/28/base 2026-11-26 03:41:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.