GPU: cap constant view sizes before rounding #1206

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

@⁠gmankab on GitHub · 2026-11-26 00:01 UTC · original
gmankab:contrib/fxceless-constant-size-overflow → main · +4 −3 · 1 files · 1 commits · open

The introduced 64 KiB constant-buffer cap rounds the raw size before comparing it to the limit. A release build wraps u32::MAX to a zero-sized view. Checking the cap first prevents this and preserves the existing diagnostic.

The extracted release helper returned 0 bytes before the change and 65,536 bytes afterward. The Windows victory-gpu constant-view regression also passed under Wine with the hardware GPU hidden.

Based-on: #911
Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3 with Wine and Lavapipe
Assisted-by: gpt-6.2 sol xhigh

**@⁠gmankab** on GitHub · 2026-11-26 00:01 UTC · [original](https://github.com/fxceless/victory-fork/pull/1206) `gmankab:contrib/fxceless-constant-size-overflow` → `main` · +4 −3 · 1 files · 1 commits · open The introduced 64 KiB constant-buffer cap rounds the raw size before comparing it to the limit. A release build wraps `u32::MAX` to a zero-sized view. Checking the cap first prevents this and preserves the existing diagnostic. The extracted release helper returned 0 bytes before the change and 65,536 bytes afterward. The Windows `victory-gpu` constant-view regression also passed under Wine with the hardware GPU hidden. Based-on: https://git.gtahub.st/github/fxceless--victory-fork/pulls/911 Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3 with Wine and Lavapipe Assisted-by: gpt-6.2 sol xhigh
The constant-view helper accepts a raw u32 size. Rounding to 256
bytes before comparing with 64 KiB can overflow. The release helper
makes a size of zero for u32::MAX, which defeats the cap and hands
the host an invalid descriptor. A checked build panics there.

Compare the raw size with the 64 KiB cap first. The remaining
rounding then fits, and the existing warning still reports oversized
requests. Extend the regression to cover zero and u32::MAX.

Based-on: 2ba6e1f998
Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3 with Wine and Lavapipe
Assisted-by: gpt-6.2 sol xhigh
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:30 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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