Repository navigation
d3d12: one guarded copy per run of adjacent written geometry tiles (RT-GEOMETRY-READBACK-RUN-MERGE) - #2085
Open
BubsMcgee wants to merge 2 commits into
Open
d3d12: one guarded copy per run of adjacent written geometry tiles (RT-GEOMETRY-READBACK-RUN-MERGE)#2085BubsMcgee wants to merge 2 commits into
BubsMcgee wants to merge 2 commits into
Conversation
…T-GEOMETRY-READBACK-RUN-MERGE) A GeometryViews refresh reads each written 64 KiB tile with its own readability probe and guarded copy, even when the title wrote a run of adjacent tiles across tile boundaries. Group the written tiles (already in address order) into maximal runs whose addresses differ by one tile and read each run a ready view needs as one guarded copy; the per-tile pass then reuses those bytes through read_tile(). A run that cannot be read whole falls back to the per-tile read, so an uncommitted page still zeroes only what it did before. Same behaviour as DexNom/VIctory's copy_fetch_runs (crates/victory-gpu/src/host.rs, GPL-3.0-or-later, commit 570a941), re-implemented for this header; no identifiers or code copied. Tested: geometry_views_test 14/14, including the new case (two adjacent written tiles are one 128 KiB copy); gta6rt_d3d12_com builds. Synthetic only, no game files or GPU. AI-assisted.
Contributor
|
From the code at this head (
AI-assisted (Claude Code, Claude Opus 5.5). |
… 1 MiB Each refresh now clears written_ and written_vas_ together at the start, so an exception from a read or a guarded copy cannot leave addresses the next refresh indexes past written_. Adjacent-tile runs are capped at 1 MiB (16 tiles), so a long contiguous write cannot force one large scratch resize.
Contributor
|
Code review at
If #2094 lands first I am happy to send the rebase of Measured: AI-assisted (Claude Code). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
GeometryViewsrefresh copies only the 64 KiB tiles the title wrote (the page diffing already there), but it reads each written tile with its own readability probe and guarded copy. When the title writes a run of tiles across tile boundaries, that is one probe and one copy per 64 KiB for data that is contiguous in title memory.This groups the written tiles (already in address order) into maximal runs whose addresses differ by one tile, and reads a run a ready view needs as one guarded copy. The per-tile pass then reuses those bytes through
read_tile(). A run that cannot be read whole (an uncommitted page inside it) falls back to the per-tile reads, so the zeroing behaviour is unchanged. Whole-view refreshes (LEONIDA_GEOMETRY_WHOLE_VIEWS=1) read nothing here, as before.Same behaviour as DexNom/VIctory's
copy_fetch_runs(crates/victory-gpu/src/host.rs, GPL-3.0-or-later, commit570a941), re-implemented for this header; no identifiers or code copied.docs/related_projects.mdalready credits the VIctory readback work.Files
runtime/shims/d3d12_geometry_views.h:read_run()/run_needed()and the run grouping inrefresh().runtime/test/geometry_views_test.cpp: case 5, two address-adjacent written tiles of one view are one 128 KiB copy (case 4's non-adjacent tiles stay two 64 KiB copies).Tests
geometry_views_test: 14/14 checks pass (synthetic, fake Vulkan device, no game data or GPU).gta6rt_d3d12_combuilds (MSVC 19.44, Windows 11 26300; RTX 3080 Ti on 616.64 present but not needed by the test).Claimed as
RT-GEOMETRY-READBACK-RUN-MERGEin the coordination issue. Independent of #1678, which touches onlyd3d12_title_buffer_windows.h. No game data. AI-assisted (opencode). Depends on: none.