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

Open
LeonardoS11 wants to merge 1 commit from upstream-pr/451 into main
LeonardoS11 commented 2026-11-27 10:27:45 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by LeonardoS11 on 2026-11-27T10:27:45Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5525064722 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/451). Originally posted by [LeonardoS11](https://github.com/LeonardoS11) on 2026-11-27T10:27:45Z. --- 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)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/451:upstream-pr/451'
git switch 'upstream-pr/451'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/451'
git switch 'upstream-pr/451'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/451'
git switch 'upstream-pr/451'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/451'
git switch 'main'
git merge --squash 'upstream-pr/451'
git switch 'main'
git merge --ff-only 'upstream-pr/451'
git switch 'main'
git merge 'upstream-pr/451'
git push origin 'main'
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
avatarmanz/VIctory-7900XTX!451
No description provided.