GPU: constant buffer views of at most 64 KiB #1640
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1640
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1640/head"
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?
@NuraadGit on GitHub · 2026-11-24 20:18 UTC · original
NuraadGit:gpu/constant-view-64k→main· +40 −2 · 1 files · 1 commits · closed without mergingA 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.
d279e69and7b0f736), which has the same code here. I haven't runmainin the title with and without this change.AI-assisted (Claude Code); counts and log lines only, nothing from the game attached.
@NuraadGit on GitHub · 2026-11-24 20:50 UTC · original
In-title result for the cap, on an RTX 2080 (fxceless/victory-gta6
7b0f736+ this change + a diagnostics-only present log, no loop limit, Series X profile).0x7fe8ba580000. The line is logged once per run, so later ones would not show.0x887A0001about 5 to 6.5 minutes after launch, two of them with a view like this among the 64 made last. The probe in the description shows that making one removes the device.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.
@NuraadGit on GitHub · 2026-11-24 23:42 UTC · original
Closing this. Since today's push to
main, nothing creates a D3D12 constant buffer view:git grep CreateConstantBufferViewfinds nothing incrates/victory-gpu. Constant views (View::Constant) are now read through raw buffer views over the host copies, so the 64 KiBSizeInByteslimit this PR capped can't be hit any more. The branch also conflicts withmainnow.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.
Pull request closed