Fix [fence 18446744073709551615 did not reach 348999] -> CopyTextureRegion subresource indices for partially resident mip chains #4126
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4126
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4126"
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?
@Vlosokjia on GitHub · 2026-11-30 16:24 UTC · original
Vlosokjia:fix/held-mip-region-copy→main· +99 −94 · 1 files · 1 commits · openOn v2026.11.30.01,v2026.11.30.02, v2026.11.30.03.I replayed the mission that had repeatedly failed with
0x80070057and got past the crash with this patch. The original command-list close failure is recorded in #4047.Change
If a host texture begins at guest mip 3, guest mip 3 is host mip 0. The direct
CopyTextureRegionpath still used the guest index, which could select a smaller mip or one outside the allocation. Resolve both endpoints independently throughresource::host_target, including the source used to calculate readback footprints. Compare the resolved indices for self-copies. When the primary destination lacks a mip, a placed twin that holds it can still receive the copy.This extends the placed-twin handling from
523485ba. The related report #3849 shows the same HRESULT with partial mip chains in use, though its release log does not identify the failing command. The cross-format BC copy reported in #2914 is a separate failure.Verification
a_copy_into_a_held_copy_takes_its_own_leveltest passed in isolation.card_passcalls inhost.rsthat omit the sixth argument.Fix CopyTextureRegion subresource indices for partially resident mip chainsto Fix [fence 18446744073709551615 did not reach 348999] -> CopyTextureRegion subresource indices for partially resident mip chains@shurhundo on GitHub · 2026-12-01 02:48 UTC · original
crate::texture::card_writes(list, dst.resource, to, Some(dst.footprint.offset as u32))atlist.rs:1825passes the title-absolute subresource offset, not thedst_subresolved two lines above byhost_target()for exactly this case (a host allocation starting at a later title mip).card_writesforwards it straight intoTiledLevels::with_level, which expects a level relative to the host texture's own mip count and returns 0 oncelevel >= self.levels— so for a partially-resident mip chain, the on-demand-tile zeroing step silently no-ops for the level actually being written. The fence crash this PR fixes is fixed, but the destination level can now land the title's copy over un-zeroed tile memory instead of the zeroed backing the old (non-partial-residency) path relied on. SuggestSome(dst_sub)in place ofSome(dst.footprint.offset as u32)there.@Vlosokjia on GitHub · 2026-12-01 05:38 UTC · original
@shurhundo
Thanks for checking this. You’re right that card_writes gets the original subresource index. It only reaches with_level for on-demand tiled textures, which always start at mip 0 and keep the original index. For a host texture starting at a later mip, card_writes returns before reaching with_level. That’s why I’m keeping the call as is in this PR.
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.