Placed texture UAVs: land writes on the title resource, not a stand-in #97
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!97
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-97"
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?
@kalijerry on GitHub · 2026-11-26 03:23 UTC · original
kalijerry:fix/placed-texture-uav→main· +219 −25 · 5 files · 3 commits · openThe bug
A placed texture bound as a UAV was mirrored to a stand-in resource nothing else read. Shader writes through it landed on the stand-in and were dropped, while every other view kept reading the title's memory.
The visible result: the ray-tracing structure builder ran, produced nothing useful, and the world's interiors rendered black - direct light only, no bounce, no shadow. Once writes landed on the right resource the picture was correct again.
The fix
Keep one resource per placed address. When several exist, the title's own allocation wins - a synthetic copy must never displace it. A descriptor made from a title resource holds a reference on it while it lives, so the object cannot be freed under an in-flight descriptor.
TARGETS_ATbecame per-address lists; the title's object is inserted first and looked up last.writable_texture_athands back the title resource when the description's shape matches and it carries the flags asked for.View::Unorderedinstead ofView::Shader, so writes go back to the title memory rather than a copy.ResourceRefis the reference holder;object::try_add_refrefuses a resource already at zero refs (its destructor takes the same lock).Verification
cargo test -p victory-gpu --lib: 326 passed, 0 failed.@avatarmanz on GitHub · 2026-11-26 07:33 UTC · original
Not merged: the not-mirrored warning copies 24 words from before the view description (desc.sub(24)) in every build, and the diagnostics probes read 64 words around a title pointer. The placed-UAV change itself would need an in-game check.
@UwUCammie on GitHub · 2026-11-26 18:36 UTC · original
I sent a fix to this PR’s source branch for the out-of-bounds diagnostic reads. Both messages now use only the descriptors passed to the API. The placed-view identity test and all eight descriptor tests passed under Wine with diagnostics enabled and disabled. The in-game check for the UAV change is still open. Source branch PR
@akimfomin on GitHub · 2026-11-26 23:42 UTC · original
The #97 port onto
014d52dedf837d1ac660a0bd256c4704be9eeb40needs one change beyond resolvingdraw.rs. I merged856b6f87ea7b08b092a57b95796e962f0a703b2elocally and retained main'shost_heaps_set. Git mergeddescriptor/host.rsautomatically, but the newbegun_beforematch then failed with E0308: one arm yieldedPlacedTexture, the otherView.A local resolution kept
let placed;alive throughpool::begun_before, borrowed&placed.viewin the placed arm, and returnedviewdirectly in theView::Shaderarm. This keeps #97's resource owner alive during the lookup. On treee7d0b88fbea83194211b1df36bbf7964ea85aa2e,cargo test --locked -p victory-gpu --lib placed_texture -- --test-threads=1 --nocapturebuilt and all 4 tests passed on Windows. This is focused rebase evidence, with the full suite and the gameplay case still open. PortBridge · AI-assisted source and test report.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.