Fence waits for new memory and deferred residency check for device loss; narrow barrier groups keep the whole call beside a UAV wildcard #634
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!634
Loading…
Reference in a new issue
No description provided.
Delete branch "deama/Darner:c14/barriers-fences"
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), written to stop GPU timeouts. Both problems were found by reading the code, not in a run.Contributor role (optional)
What it changes
mapped()andwith_copy_queue_sync()signal the aside COPY queue and wait only while the fence reads below the target. A lost device (every fence readsu64::MAX) passes at once, andWaitForSingleObject's result is ignored. Both report the memory as mapped, or the tile mappings done, when nothing ran.DARNER_RESIDENT_LATER=1,wait_askedpasses a lost device in the same way, spins when the event can't be made or set, and movesSETTLEDeven whenmapped()failed, so descriptor slots naming non-resident memory get written.before_send()sends the lists without the wait on a lost device or a failed queueWait.DARNER_NARROW_BARRIERSnaminggroups: the first record of a call that needs a UAV barrier on every resource ends the replay with only that wildcard, dropping the call's scoped globals and buffer barriers (a UAV barrier orders only unordered access, not render targets, copies or reads after a write). A null-resource buffer barrier sends the whole call to the global fallback. A texture barrier mixing UAV with another access and aSYNC_NONEside is skipped.Two commits:
host: fence waits for new memory and deferred residency are checked
list: narrow barrier groups keep the whole call beside a UAV wildcard
Aside::signal_and_waitreturns an error for a lost device and a failed wait, and reads the fence again after waking. Callers already warn and degrade on errors.DARNER_RESIDENT_LATER=1useswait_host_fence. A lost device, a failed wait or a failedmapped()end the run (fail) beforeSETTLEDmoves.before_send()ends the run on a lost device or a failed queueWait.Narrow-groups replay gathers every record, records the enhanced globals and buffer barriers, then adds the one UAV wildcard (skipped when an
ALL → ALLglobal was recorded, which covers it). Without list7 the wildcard is recorded as before, and buffer references are still released. Mixed texture UAV↔other access is a scoped global even with aSYNC_NONEside (widened to ALL bysafe_sync); only pure UAV→UAV stays a single-texture UAV barrier.Left out from the source: compute-queue and
PARTS_ONE_CALLsubmission paths and aJOIN_NOWAITjoin check (Darner has no compute queue, and its split path already runsbefore_sendbefore everyExecuteCommandLists, #190), and theuavonly-moderequire_scopeflag (Darner has no such mode).How it was tested
45e04e0d90(branch head; gates below). Game runs used a combined test build that contains it.45e04e0d90, 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; 3 new tests: 3 pass.cargo xtask policy: ok (576 files).DARNER_NARROW_BARRIERSandDARNER_RESIDENT_LATERwere at their defaults (off), so the changed barrier and residency paths did not run in the game.mapped()/with_copy_queue_sync()return an error on a lost device or failed wait instead of success.SYNC_NONEbefore) now becomes an ALL→X global, which is safer but may cost frame time (not measured). Without enhanced barriers or list7, a mixed texture dependency still gets only a null UAV barrier.Checklist
main.docs/asset-policy.md.Checked for overlap
DARNER_RESIDENT_LATER:before_send()also waits for the mapping on the sending thread). It touches the samewait_askedandbefore_sendcode and the two combine: #57 adds the mapping wait, and this PR makes those waits fail on a lost device or failed wait instead of passing. Whichever merges second needs a rebase. #599 (title-barrier timing): whichever merges second keeps #599'srecord_title_barrierwrapper around this PR'sBarrierandResourceBarriercalls inlist.rs. Also #517 (console flags on UAV/aliasing barriers, different barriers) and #93 (DARNER_LATE_FENCE, a different fence wait).[pr-fix][rendering] Fence waits for new memory and deferred residency check for device loss; narrow barrier groups keep the whole call beside a UAV wildcardto Fence waits for new memory and deferred residency check for device loss; narrow barrier groups keep the whole call beside a UAV wildcardTest needed — commit
45e04e0d; what to check:mapped()andwith_copy_queue_sync()signal the aside COPY queue and wait only while the fence reads below the target. A lost device (every fence readsu64::MAX) passes at once, andWaitForSingleObject's result is ignored. Both report the memory as mapped, or the tile mappings done, when nothing ran.DARNER_RESIDENT_LATER=1,wait_askedpasses a lost device in the same way, spins when the event can't be made or set, and movesSETTLEDeven whenmapped()failed, so descriptor slots naming non-resident memory get written.before_send()sends the lists without the wait on a lost device or a failed queueWait.DARNER_NARROW_BARRIERSnaminggroups: the first record of a call that needs a UAV barrier on every resource ends the replay with only that wildcard, dropping the call's scoped globals and buffer barriers (a UAV barrier orders only unordered access, not render targets, copies or reads after a write). A null-resource buffer barrier sends the whole call to the global fallback. A texture barrier mixing UAV with another access and aSYNC_NONEside is skipped.Two commits:
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
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.