A pooled texture or buffer is handed out only once it holds the hook that gives its piece back #637
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!637
Loading…
Reference in a new issue
No description provided.
Delete branch "deama/Darner:c14/pool-shadow"
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?
Run in the game only inside a combined test build (official
mainc8258f9+ #594–#601 + this PR + the two other fix PRs from the same source), not on its own. Ported from uncommitted "Patch C14" work in a local VIctory-NVIDIA tree (before the rename). Error-path hardening found by reading the code.Contributor role (optional)
What it changes
SetPrivateDataInterfacerefuses the object that gives its piece back (give_back_to). The piece then stays taken for good. A texture without the private data is treated as not pooled, so its first upload gets no aliasing barrier over what the card last did in that memory. It is also counted (HELD, the card ledger, the census, the park's counters) before the hook is attached.One commit:
pool: a placed resource is handed out only once it holds the hook that gives its piece back
The hook comes first (
Reclaim::register). If it can't be attached, the resource is let go first, and only then is its piece free again: at once and uncounted, since no list named it (Reclaim::registeredtellsrelease).The caller falls back as when placement fails:
texturegivesPooled::Unpooled,texture_movedandcpu_buffergiveNone. The counts (PARK_HOLE_USED among them) are taken only after success. A buffer that can't be mapped is let go before its piece is given back.A test checks the order and the pool's figures on a heap of the software adapter, and fails if the immediate reclaim is replaced by a normal rest.
Not ported from the source: its serialized growth of 4 MiB card-buffer heaps and its tight-shadow root protection. Both act on card buffers and tight shadows that exist only in the source tree's uncommitted work, not in Darner.
How it was tested
b9f575ba84(branch head; gates below). Game runs used a combined test build that contains it.b9f575ba84, Windows 10 22H2 with its built-in Direct3D 12 (no Shader Model 6.6), Rust 1.98.1:cargo clippy --workspace --all-targets --locked -- -D warnings: passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passedcargo --config 'profile.test.package.darner-shader.opt-level=3' test --workspace --locked --no-fail-fast(the opt-level only speeds up darner-shader's exhaustive float tests): 66 failed, all of which fail on unmodifiedmain(c8258f9556) on this PC too (darner-shader tests that need Shader Model 6.6).maintoo, so its tests were run in batches that survive the abort and compared one by one withmain(main: 1658 pass, 8 fail, 139 need Shader Model 6.6, 81 ignored): no test that passes onmainfails here, none removed; 1 new tests: 1 pass.cargo xtask policy: ok (576 files).give_back_to; the three current callers don't.Checklist
main.docs/asset-policy.md.Checked for overlap
[pr-fix][memory] A pooled texture or buffer is handed out only once it holds the hook that gives its piece backto A pooled texture or buffer is handed out only once it holds the hook that gives its piece backTest needed — commit
b9f575ba; what to check:SetPrivateDataInterfacerefuses the object that gives its piece back (give_back_to). The piece then stays taken for good. A texture without the private data is treated as not pooled, so its first upload gets no aliasing barrier over what the card last did in that memory. It is also counted (HELD, the card ledger, the census, the park's counters) before the hook is attached.One commit:
pool: a placed resource is handed out only once it holds the hook that gives its piece back
The hook comes first (
Reclaim::register). If it can't be attached, the resource is let go first, and only then is its piece free again: at once and uncounted, since no list named it (Reclaim::registeredtellsrelease).The caller falls back as when placement fails:
texturegivesPooled::Unpooled,texture_movedandcpu_buffergiveNone. The counts (PARK_HOLE_USED among them) are taken only after success. A buffer that can't be mapped is let go before its piece is given back.A test checks the order and the pool's figures on a heap of the software adapter, and fails i
Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.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.