GPU: upload CPU-written textures before full and region copies #671
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!671
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/671/head"
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?
@fuzeofficlal on GitHub · 2026-11-24 06:31 UTC · original
fuzeofficlal:fix/copyresource-cpu-texture-source→main· +6 −0 · 1 files · 2 commits · merged 2026-11-24 08:20 UTCProblem
The first GPU use of a CPU-written source texture can be a whole
CopyResourceor a texture-to-textureCopyTextureRegion. Both paths previously recorded the copy before uploading the CPU-authored bytes.Change
The two commits use the existing
title_writtencheck and texture upload path before recording each copy's transitions.Verification
d2a4bae, 0/16 pixels matched(1,1)..(3,3)to destination(1,2)0064c08, all four copied pixels read zero, 12 outside pixels matchedThe explicit-upload, GPU render target, and GPU-copy-written source controls matched all 16 pixels. The D3D12 debug layer reported zero errors. The whole-copy controls were rerun after the region change. The diagnostics GPU suite passed on both adapters, with 45 passed and one existing benchmark ignored per adapter. The staged asset policy check passed.
@ifBars on GitHub · 2026-11-24 06:50 UTC · original
I reproduced this on the downstream Causeway renderer with Agility WARP and GPU-based validation. The test writes a 4×4 RGBA8 guest texture and calls the guest command list's CopyResource twice, A → B → C. B's guest memory stays zero, so the second copy also checks that first-use upload respects GPU ownership.
Before the change, all 16 pixels read back from C were zero. With these three lines after Causeway's format check, all 16 matched the source. No game files were used for the regression test. The fixture is in Causeway #26. AI-assisted verification with Codex.
@fuzeofficlal on GitHub · 2026-11-24 07:04 UTC · original
I checked the staging-order question on
4f53d6f.texture::uploadrecords the staging-buffer-to-texture copy in the command list before the texture-to-destination copy. It defers filling the staging buffer.Host::executeruns that fill before submitting the list.For a direct check I recorded and closed each copy, then changed the synthetic CPU texture before calling
Host::execute. On both RTX 5090 and WARP, the whole and region copies each matched 16/16 pixels against the later pattern, including the untouched pixels outside the region. The GPU-written controls kept their GPU values despite the CPU edit. The debug layer reported zero errors.