descriptor: a constant buffer's raw view stops at the buffer's end #451

Open
github-bot wants to merge 1 commit from github-bot/gh-451 into main AGit
Owner

@⁠LeonardoS11 on GitHub · 2026-11-27 10:27 UTC · original
LeonardoS11:pr/av-cb-raw-clamp → main · +9 −3 · 1 files · 1 commits · open

The raw (R32_TYPELESS) view of a constant buffer took SizeInBytes / 4 elements, where the size is rounded up to 256 bytes. Near the end of a buffer that reaches past it, which D3D12 does not allow. constant_raw_at already clamps to width - offset; this makes the other raw view(s) in descriptor/host.rs do the same.

On the nvidia-wip line there are two such views: the constants_own_slot one, which is on with VICTORY_PORT_CBV=1 on NVIDIA, and the twin's. On main there is only the twin's.

mgrein reports a device removal on an RTX 4070 from such a view (877d5b4, fixed in 9849f04 of mgrein's fork); credit for finding it goes there.

Not measured by us: our runs do not use PORT_CBV=1, so we never hit it. The case is the code plus that report. It type-checks; no behaviour change when the view already fits.

AI-assisted (Claude in Claude Code). Built from source; no game data.

🤖 Generated with Claude Code

**@⁠LeonardoS11** on GitHub · 2026-11-27 10:27 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/451) `LeonardoS11:pr/av-cb-raw-clamp` → `main` · +9 −3 · 1 files · 1 commits · open The raw (R32_TYPELESS) view of a constant buffer took `SizeInBytes / 4` elements, where the size is rounded up to 256 bytes. Near the end of a buffer that reaches past it, which D3D12 does not allow. `constant_raw_at` already clamps to `width - offset`; this makes the other raw view(s) in `descriptor/host.rs` do the same. On the nvidia-wip line there are two such views: the `constants_own_slot` one, which is on with `VICTORY_PORT_CBV=1` on NVIDIA, and the twin's. On main there is only the twin's. mgrein reports a device removal on an RTX 4070 from such a view (877d5b4, fixed in 9849f04 of mgrein's fork); credit for finding it goes there. Not measured by us: our runs do not use `PORT_CBV=1`, so we never hit it. The case is the code plus that report. It type-checks; no behaviour change when the view already fits. *AI-assisted (Claude in Claude Code). Built from source; no game data.* 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The raw (R32_TYPELESS) view of a constant buffer took constant_bytes(size)/4 elements: the size rounded up to 256 bytes, which can reach past the end of the buffer it is a view of. constant_raw_at already clamps to width - offset; these views now do the same. mgrein reports the device removed on an RTX 4070 by such a view (877d5b4, fixed in 9849f04).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:38:59 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/451/head:github-bot/gh-451'
git switch 'github-bot/gh-451'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-451'
git switch 'github-bot/gh-451'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-451'
git switch 'github-bot/gh-451'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-451'
git switch 'main'
git merge --squash 'github-bot/gh-451'
git switch 'main'
git merge --ff-only 'github-bot/gh-451'
git switch 'main'
git merge 'github-bot/gh-451'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.