Repository navigation
GPU: upload a host-copied texture again once the title writes its memory - #1210
powplusplus wants to merge 1 commit into
Conversation
GPU: upload a host-copied texture again once the title writes its memory (Marvisak#1210)
|
With Setup: head fd59489 on main ffe310e (clean merge), Windows 11, RX 6750 XT, Rust 1.98.1 MSVC, What I think happens, from the source:
Ways out, smallest first:
Unit tests only, no game files. AI-assisted (Claude found it in a batch run and traced it in the source; I ran the tests on my machine). |
|
I compared this with #1547, which fixes the same issue. This PR is the more complete fix:
These points apply to both PRs:
Render targets, depth and UAV textures are not affected in either PR, because Interaction with #230 (
AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090. |
|
Automated triage for the maintainers. Needs rebase. This pull request conflicts with Generated by Claude Code |
… level as it is (fork PR Marvisak#1210) ResourceMinLODClamp counts from the resource's level 0, so moving the view's first level must not lower it; lowered, a view could sample a level the title held back. Its author's test on an RTX 4080 and WARP; read whole, applied as it is; its card test not run here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A texture that received a GPU copy or resolve kept the host contents for good, so later title writes (streamed mips, for example) never reached the host copy. At the host-writing submission (`host_writes`), snapshot where title memory stands on `HostTexture`: a `watch::Tracked` handle plus a content hash for runtime-tracked memory (pools and physical-page views, so 64 KiB page false sharing does not discard host texels), or a content hash otherwise. `bindless::uploads` checks `still_host_written` once per submission; once title bytes actually change, the host-written marker is cleared and staging's last-detiled hashes are reset so the next refresh uploads the new title bytes. Fixes Marvisak#758
fd59489 to
60f6d1a
Compare
|
@powplusplus I ran the same two-mip RGBA8 regression on
Three runs per revision on app-local Agility 1.620.2/WARP 1.0.22 gave the same values for both write-watched and untracked allocations. The ordinary diagnostics suite on the PR tree passed with 249 tests and 2 ignored, and strict GPU Clippy passed with all features. This is synthetic D3D12 evidence. A title capture would establish whether this combination occurs in the game. The opt-in regression is one test-only commit on your head. It checks that mip 1 takes the CPU update while mip 0 keeps the GPU copy. Could you check whether the fix can retain the host contents for untouched subresources? If you reuse the test, please retain its Git author on cherry-pick or rebase, or add |
… level as it is (fork PR Marvisak#1210) ResourceMinLODClamp counts from the resource's level 0, so moving the view's first level must not lower it; lowered, a view could sample a level the title held back. Its author's test on an RTX 4080 and WARP; read whole, applied as it is; its card test not run here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 41f9857)
|
@powplusplus I tested a subresource follow-up The updated Could you review this approach and check it against a title capture? The logical baseline adds CPU detiling when a host copy is recorded for submission and when its title bytes actually change. I have synthetic correctness results and no title timings for that path. If you reuse the commits, please retain their Git author on cherry-pick or rebase, or add |
|
I also checked the selective mip candidate with #3288's shared texture view refresh. The bindless conflict has a tested resolution. The original four replacement-view tests passed, and partial CPU mip updates still preserve GPU-written mip contents across the linear and packed cases. Combined WARP results and branch. AI-assisted with Codex. |
… level as it is (fork PR Marvisak#1210) ResourceMinLODClamp counts from the resource's level 0, so moving the view's first level must not lower it; lowered, a view could sample a level the title held back. Its author's test on an RTX 4080 and WARP; read whole, applied as it is; its card test not run here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 41f9857)
Fixes #758.
Once a texture received a GPU copy or resolve,
upload()skipped it until the resource was released, so later title writes to its memory (streamed mips, for example) never reached the host copy.host_writtennow records where the memory stood at the copy: the write-watch asking for watched memory, a content hash for physical-page views.upload()keeps the host contents only while the memory is unchanged since then. Render targets, depth and UAV textures are not tracked, sinceupload()never runs for them.Tested:
cargo test -p victory-gpu: two new tests, one for write-watched memory and one for hashed memory