GPU: cap constant view sizes before rounding #1203

Open
gmankab wants to merge 1 commit from upstream-pr/1206 into main
gmankab commented 2026-11-26 00:01:48 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by gmankab on 2026-11-26T00:01:48Z.


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://github.com/fxceless/victory-fork/pull/911
Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3 with Wine and Lavapipe
Assisted-by: gpt-6.2 sol xhigh

<!-- greyfinch-sync:fxceless/victory-fork:issue:6616327339 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1206). Originally posted by [gmankab](https://github.com/gmankab) on 2026-11-26T00:01:48Z. --- 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://github.com/fxceless/victory-fork/pull/911 Tested-on: Fedora Linux 45, Intel Xeon E5-2670 v3 with Wine and Lavapipe Assisted-by: gpt-6.2 sol xhigh
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/1206:upstream-pr/1206'
git switch 'upstream-pr/1206'

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/1206'
git switch 'upstream-pr/1206'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1206'
git switch 'upstream-pr/1206'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1206'
git switch 'main'
git merge --squash 'upstream-pr/1206'
git switch 'main'
git merge --ff-only 'upstream-pr/1206'
git switch 'main'
git merge 'upstream-pr/1206'
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
fxceless/victory-fork!1203
No description provided.