Placed texture UAVs: land writes on the title resource, not a stand-in #97
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by kalijerry on 2026-11-26T03:23:01Z.
The 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.Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:33:30Z.
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.
Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-26T18:36:13Z.
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
Imported from avatarmanz/VIctory-7900XTX. Originally posted by akimfomin on 2026-11-26T23:42:13Z.
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
Checkout
From your project repository, check out a new branch and test the changes.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.