GPU: refuse raw buffer views that do not start on 16 bytes #123
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!123
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-123"
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?
@9hvn9yt2vk-netizen on GitHub · 2026-11-24 00:41 UTC · original
9hvn9yt2vk-netizen:raw-view-alignment→main· +119 −0 · 1 files · 2 commits · openA raw buffer view on the host must start on a multiple of 16 bytes; the console needs only 4. buffer_srv and buffer_uav move a view's first element by where its memory sits in the host copy, so a title's raw view could land on 4, 8 or 12 bytes past a 16-byte boundary. The host then refuses CreateShaderResourceView (or CreateUnorderedAccessView), and the device is removed (0x887A0001). A user report from the world:
CreateShaderResourceView: When creating a RAW Shader Resource View, the
offset of the first element from the start of the buffer must be a
multiple of 16 bytes. Thus, FirstElement (42261210) must be a multiple
of 4 since each element is 4 bytes.
Such a view is now refused like one that is not on an element: the slot gets a null view of its kind (reads zeros) and a warning is logged once. Starting the view 16 bytes lower would need the shader to add the difference.
Type-checked and clippy-clean for x86_64-pc-windows-msvc (cross-checked from Linux with -Zbuild-std); not run against the title.
@DaviTostes on GitHub · 2026-11-24 00:49 UTC · original
Tested
828e3cdunder Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.victory_gpu: 36 passed, 3 failed — the same count and the same three environment-only failures asmain(argument_clamp_builds,a_rejected_blob_gives_an_empty_library, #128'sVirtualQueryupload skip). The diff adds no test for the new 16-byte check, so this run only shows nothing else broke; a syntheticCreateShaderResourceViewwith a non-16-byte-aligned raw offset would cover it (vkd3d-proton is strict about that alignment too).No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
@oVolkra on GitHub · 2026-11-24 01:03 UTC · original
Tested
828e3cd6(merged onto maind2a4bae1) on RTX 3060, driver 617.14, Windows 11: passcargo test --workspace: 264 passed, 0 failed, 4 ignored (same counts as maind2a4bae1)cargo clippy --workspace --all-targets: no new warnings (the same 2 as main)cargo xtask policy: cleanNot tested: the game was not run, so the 16-byte guard is not exercised on a GPU. The PR adds no unit test for
raw_start_fits, so a passing suite only shows that it builds and breaks nothing else.AI-assisted: this test was run and written up with Claude Code; the numbers above are its unedited output.
@ChruutvoLuzi on GitHub · 2026-11-24 03:00 UTC · original
In-game data for the guard, which the comment above says wasn't exercised. RTX 4090, driver 621.01, Windows 11.
828e3cdmerged ontod2a4baetogether with #189, #205, #206, #134 and #89 (it conflicts with #206 inbuffer_srvandbuffer_uav; I kept #206's code and ran this check after it). Diag build, the first mission's opening each time.Across 13 runs that reached the world,
raw buffer view not on 16 bytes of its host copyand its unordered-view twin never fired. Three of those runs did end in0x887A0001, but that was #55 at the time: a check of the device around every descriptor call traced it toCreateRenderTargetViewon a texture #55 had made without render-target use, the case discussed in #55, not to a raw view. The others ended in the0x887A0006hang from #71. So on this card the guard costs nothing in this part of the game, and the raw-view invalid call it prevents didn't come up here.AI-assisted (Claude Code).
@9hvn9yt2vk-netizen on GitHub · 2026-11-24 09:46 UTC · original
Thanks for testing and reviewing! Rebased onto current main (
8e79c80) and added the tests you asked for: raw_views_start_on_16_bytes (which starts the check lets through and refuses, the reported FirstElement 42261210 included) and raw_views_that_fit_are_accepted_by_the_device (every start the check lets through is made as a raw SRV and UAV on the real device, which stays alive). Passes locally on an RTX 4060 with your new CI commands. Agreed that the full fix is the follow-up where the shader adds the offset difference.@Marvisak on GitHub · 2026-11-25 00:17 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/descriptor/host.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
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.Merge
Merge the changes and update on Forgejo.