You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(agc): preserve registered array slices on CPU write-back - #6367
Preserve GPU results during CPU write-back when the selected texture-array slice is registered but unused slices in the descriptor extend outside registered memory.
For example, only slice 0 of a four-slice array may be registered and have pending results. StorageTexture::writeBackLayers previously checked registration of the entire declared image and discarded slice 0's valid results because the unused slices were unregistered. It also refreshed unsaved guest bytes outside the ranges being stored.
Validate each retained write-back range instead, and intersect unsaved snapshot reads with those ranges. Keep the existing overhang handling and drop behavior when an actual destination has been unregistered. No public API or shader-semantic changes; no title-specific checks.
The regression registers only the first or last slice while keeping the complete backing allocation mapped. It checks the drawn pixels and untouched unused slices. A separate retirement case unregisters the active allocation before flushing and verifies that no stale results are written.
SuperTuxKart PPSA69421 supplied real two-slice descriptors whose active first slice fits its registered allocation while the entire descriptor does not. This PR does not claim a title unblock, a black-rendering correction, or a performance improvement.
Related work checked before publication: #6202 scopes refresh and adds independent coverage in the same test file; #6197 changes import selection, including within writeBackLayers; #6280 changes mip handling within that function; #6246 adds an allocation lease for idle stores. None implements this retained-range registration check or snapshot-read intersection. These are independent mechanisms; retain their changes and this regression when reconciling textual conflicts. No dependency on those PRs or the shader experiment tracked by #1413.
python tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD pass; tracked working tree clean.
Remaining validation: fresh standalone SuperTuxKart and vkQuake baseline/candidate comparisons, a completed race, controls/audio checks on this candidate, and a 15-minute stability run. Earlier successful interactive rendering/controls/audio used a separate experimental runtime and are not acceptance evidence for this PR. Linux, lavapipe and other GPU vendors have not been tested locally. No speed claim or performance acceptance result.
Checklist
Based on current main; no other open PR implements the same fix (related function/file overlap listed above)
One topic per PR; follow-ups go in a new PR
No comments in code except technical debt (no comments added)
Unimplemented paths retain strict failure behavior; no silent stubs added
No notes, investigation .md files, images, logs or game files added to the repository
New third-party code is a submodule built from source (none added)
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
Heads-up from #6960 : it also changes writeBackLayers' read of unsaved guest bytes on the CPU path. It moves the read before the keep decision, because the store now uses a compare-exchange against those bytes, and reading them after the decision lets a CPU store made in between pass as the expected value. Your PR can go first; I'll rebase and keep your registered-range restriction, applied to that earlier read.
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
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.
What
Preserve GPU results during CPU write-back when the selected texture-array slice is registered but unused slices in the descriptor extend outside registered memory.
For example, only slice 0 of a four-slice array may be registered and have pending results.
StorageTexture::writeBackLayerspreviously checked registration of the entire declared image and discarded slice 0's valid results because the unused slices were unregistered. It also refreshed unsaved guest bytes outside the ranges being stored.Validate each retained write-back range instead, and intersect unsaved snapshot reads with those ranges. Keep the existing overhang handling and drop behavior when an actual destination has been unregistered. No public API or shader-semantic changes; no title-specific checks.
The regression registers only the first or last slice while keeping the complete backing allocation mapped. It checks the drawn pixels and untouched unused slices. A separate retirement case unregisters the active allocation before flushing and verifies that no stale results are written.
SuperTuxKart PPSA69421 supplied real two-slice descriptors whose active first slice fits its registered allocation while the entire descriptor does not. This PR does not claim a title unblock, a black-rendering correction, or a performance improvement.
Related work checked before publication: #6202 scopes refresh and adds independent coverage in the same test file; #6197 changes import selection, including within
writeBackLayers; #6280 changes mip handling within that function; #6246 adds an allocation lease for idle stores. None implements this retained-range registration check or snapshot-read intersection. These are independent mechanisms; retain their changes and this regression when reconciling textual conflicts. No dependency on those PRs or the shader experiment tracked by #1413.Tested
Based on upstream
main73e924a; PR commit 540c3a1.Windows (10.0.26200), Intel Core i7-13700, 32 GiB RAM, NVIDIA RTX 4070 12 GiB, driver 591.86. GCC 15.2.0, Ninja, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON; checked-out submodule revisions match the repository gitlinks. Rebuilt the completelibstarget and focused test binaries; preserved a complete 126-library runtime snapshot with SHA-256 hashes locally.Texture.cpp,agc_driver_array_layer_targetfails in 1.56 s:ANYPS5_GPU=RTX 4070andANYPS5_REQUIRE_VULKAN=1:agc_storage_kept_unit_settle,agc_storage_upload_lifetime,agc_storage_upload_failure,agc_storage_split_writeback,agc_host_import_retirement,agc_storage_cpu_snapshot;agc_driver_graphics,agc_driver_array_layer_target,agc_driver_depth_fast_clear,agc_driver_depth_fast_clear_submit,agc_driver_depth_storage,agc_driver_depth_storage_reuse,agc_driver_storage_one_slice_alias,agc_driver_storage_write_back_overhang.python tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpass; tracked working tree clean.Remaining validation: fresh standalone SuperTuxKart and vkQuake baseline/candidate comparisons, a completed race, controls/audio checks on this candidate, and a 15-minute stability run. Earlier successful interactive rendering/controls/audio used a separate experimental runtime and are not acceptance evidence for this PR. Linux, lavapipe and other GPU vendors have not been tested locally. No speed claim or performance acceptance result.
Checklist
main; no other open PR implements the same fix (related function/file overlap listed above).mdfiles, images, logs or game files added to the repositoryExtended validation remains pending; this PR makes no title-unblock or performance claim.