Skip to content

[Review import] GPU: refresh whole pages touched (upstream #3289) - #7

Draft
maok625 wants to merge 1 commit into
mainfrom
review/upstream-pr-3289-page-wide-refresh
Draft

maok625 wants to merge 1 commit into
mainfrom
review/upstream-pr-3289-page-wide-refresh

Conversation

@maok625

@maok625 maok625 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Imported from Marvisak#3289 for review on this fork.

Upstream source head: d99e868f7b5f188df512ae7313ffc0d9480a99e6 (from QalityDev/VIctory). It is directly based on the current fork main commit 63bcca43c6a00a758510398fa43096ce7e4f7df0.

Interaction warning: touches shadow.rs, also modified by imported Marvisak#3318. Review both against each other before merging.

Draft import only. Inspect all touched code and tests, resolve interactions with sibling review branches, and run Windows/D3D12 tests before merging. No local build or GPU validation has been performed by this import.

A refresh of a range that cuts a 64 KiB page copied that part and left
the page changed (`Tracked::take`), so every later refresh reaching it
copied it again, whether or not the title had written it since. The
world refreshes small ranges inside the title's 174 MB GPU-heap buffer
dozens of times per frame: on an RTX 4060 Ti, 410-550 MB of the
550-690 MB copied per frame came from such partial pages, against
100-140 MB from pages taken whole.

`Shadow::update` now widens the range to the pages it touches (cut to
the copy). Taken whole, a page is guarded and copied again only once
the title writes it. Ranges whose shaders' writes stay in the copy
(`keep_writes`) are remembered and the widening stops short of them;
ranges shaders are writing go through the existing busy split.

Measured in the intro cutscene (diagnostics build, the four heaviest
compute pipelines skipped to isolate CPU preparation):

  before: copies 290-395 ms, 550-690 MB per frame; 700-730 ms/frame
  after:  copies  69-108 ms,  73-120 MB per frame; 380-445 ms/frame

Diagnostics: the copy-stats line reports bytes taken from whole and
partial pages. New test `a_partial_refresh_takes_the_whole_page`;
On main 63bcca4: victory-gpu lib tests 230 passed (the two that fail,
dynamic_slots_are_held_until_released and
lists_share_a_table_and_copies_keep_their_views, fail on main as well
on this RTX 4060 Ti); clippy clean with and without `diagnostics`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants