Repository navigation
fix(vk): no mirror is made inside a parallel replay's segment - #1184
Merged
Merged
Conversation
…lier segment read it unfilled) mirror_make fills a pool's new mirror in the uploads of the segment whose worker bound the pool first, and points the page table at it at once. Workers record out of order: an earlier segment, submitted first, read the mirror before its fill (missing houses, rocks and bushes, torn geometry; worse with more segments, gone once every pool was mirrored). In a segment the mirror is now wanted and made at the next submission's start, as RX_VK_MIRROR_DEFER=1 does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013mj4MdWTJo5ht4ShZX8Vpp
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.
What this fixes
With
RX_VK_PARALLEL, large structures go missing in play: houses, big rocks, bushes, the tree over the Kokiri shop. With small segments, geometry is torn into huge stretched triangles. Serial replay is complete. This is theRX_VK_PARALLELpart of #994.gpu_buffer_bindmakes a pool's VRAM mirror the first time the pool is bound (mirror_make):In a parallel replay that recording is the uploads of the segment whose worker bound the pool first. The workers record out of order, so this need not be the first segment in the queue that reads the pool. An earlier segment, submitted first, reads the mirror before it is filled.
This matches what was seen:
Change
Inside a parallel segment (
par_active), the first binding no longer makes the mirror. The pool is marked wanted, and the mirror is made at the next submission's start, asRX_VK_MIRROR_DEFER=1already does for every pool. Serial replay is unchanged. The cost is that a pool first bound in a segment is read from guest memory for one more submission.tests/test_parallel_mirror_make.pychecks the first-binding condition: it fails on current main and passes with this change.Tested
RX 7900 XTX, RADV (Mesa 26.2.6), Linux. Hookshot v2.0.7 plus #1069 and #1108 plus this change. Scripted runs: the same save in front of the Kokiri shop, 4 camera directions, 2 runs per setting.
RX_VK_PARALLEL=0RX_VK_PARALLEL=4RX_VK_PARALLEL=4,RX_VK_PARALLEL_SEG=40RX_VK_PARALLEL=4,RX_VK_PARALLEL_SEG=1000000(one segment)Ruled out before this was found: #1069 (
RX_VK_RB_REFRESH_EACH=1),RX_VK_NO_DESC_REUSE,RX_VK_NO_GRID_PATCH. #1108 alone was not tested without this change.Not covered
mirror_syncinside a segment (a pool synced by a later segment first) was already handled bysync_segand is unchanged.🤖 Generated with Claude Code