fix(vk): Arc B580 no longer draws white shards while moving: a part ends only right before a plain draw #443
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!443
Loading…
Reference in a new issue
No description provided.
Delete branch "nyannoying/Longshot:fix/part-begins-with-plain-draw"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
On an Intel Arc B580, Kokiri Forest shows white shards (exploded triangles over the ground, trees and Link) for single frames while you walk, in about 2% of the frames.
What changed
RX_VK_CHUNK,maybe_split()ingpu/vk/vk_replay.cpp) no longer ends a part right after its 120th draw or dispatch.maybe_split()asks for the end (part_end_wanted) andreplay()makes it (split_part()) right before the next plain draw that will be recorded, so no cut leaves a part beginning with a mesh draw or a dispatch.part_ends_before_draw()decides it: on by default on Intel,RX_VK_SPLIT_BEFORE_DRAWeither way elsewhere. The comment there has the cause and the numbers.tests/test_split_before_draw.pychecks the request, the cut and its place inreplay()(it fails onmain).tests/test_split_ub_flush.pyandtests/test_parallel_small_cb.pyread the part's end insplit_part()now.RX_VK_SPLIT_BEFORE_DRAWrow indocs/development.md.Flags and settings
RX_VK_SPLIT_BEFORE_DRAW=0/1What was found
RX_VK_PROTECT_BARE=1, mirror syncs in later parts. The Khronos validation layer (1.4.363) names nothing, with or without a cut.Measurements
main:
5e072fc8(2026-11-14)this PR: fix/part-begins-with-plain-draw @
f3264534Hardware: Intel Arc B580 12 GB, driver 32.0.101.9154; Core i5-13600K; 64 GB; Windows 11 Pro (26100-series Insider, 10.0.29704)
Scene: Kokiri Forest (child), a recorded 30 s walk from Link's balcony replayed through the control bridge (the same stick input every run); frame generation off
Method: the switch alternated run by run on one build. Three pairs with a screenshot of every presented frame the bridge could take (330-390 a run), each counted for white shards (pixels of 235+ in all channels below the top fifth of the picture, 2,000 or more) and the flagged ones looked at; then two pairs without screenshots for the frame rate, from the log's
vi: ... frames presented (... fps over the last 5.0 s)lines.How to reproduce: walk through Kokiri Forest for a minute on an Arc B580;
RX_VK_SPLIT_BEFORE_DRAW=0gives main's behaviour.Baseline: this PR @
f3264534,RX_VK_SPLIT_BEFORE_DRAW=0(main's path), which is main's code path. main itself was not the comparison because on the B580 it loses the device entering Kokiri Forest (the float atomic add loop; fixed in #444). The build that ran is this PR's change (f3264534,gpu/vk/vk_replay.cppalone) applied to 4da0099b: maincf605c85with three changes not merged yet, that float-add fix (3c8b0a99), the uniform snapshot on Arc discrete cards and XeSS (b46daa73). Both columns are that one build; only the switch differs. This PR's branch itself is on main5e072fc8and was not run in the game on this card for that reason;gpu/vk/vk_replay.cpp's change applies to both bases unchanged.f3264534,RX_VK_SPLIT_BEFORE_DRAW=0(main's path)f3264534(default: 1 on Intel)The first window of each run includes the walk's start, the fifth a turn against a tree; the frame rate is the same both ways.
Testing
Tested: Arc B580, 101.9154, Windows 11, Kokiri Forest: the runs above (ten files in
docs/tested/), plus on a debug build of the same change the forced cut (0 of 324, against 333 of 335), a cut whose place steps through the submission frame by frame (0 of 326, against 5 full-screen frames in 980), and three more walks (0 of 1,134). Outside the forest, four more launches alternated the same way, each to Hyrule Field and the Market by the debug teleport with the walk's first 20 s in each: Hyrule Field 12 of 496 frames with shards withRX_VK_SPLIT_BEFORE_DRAW=0(4 of 232, 8 of 264) against 0 of 496 with the default; the Market 1 of 236 (a broken frame right after the arrival, perhaps not this fault) against 0 of 156. No device loss in either.python -I -B tests/run_all.py: 486 passed, 6 failed, 70 skipped; the 6 aretest_module_ids,test_pad_layout,test_tested_configurations,test_oot_state_tap,test_fpx_stickyandtest_spawn_emit, which fail the same way on main5e072fc8here.Not tested: areas other than Kokiri Forest, Hyrule Field and the Market (the Market's walks are partly a load, so it is thinly covered); other Intel GPUs; Linux, a Linux build included (no Linux compiler on this PC: the change adds two flags and a function in plain C++ with no platform call, and T-VQXE builds it there, so the template's two-platform box is left out, not ticked); long sessions;
RX_VK_PARALLEL(off by default; the cut is refused there as before).Needs other testers:
RX_VK_SPLIT_BEFORE_DRAW=0(T-VQXE)Screenshots
Kokiri Forest while walking, Arc B580: posted in the first comment (frames with shards from a run with
RX_VK_SPLIT_BEFORE_DRAW=0).Risk and rollback
Only Intel GPUs change by default. A part can run a few draws past 120 until a plain draw comes, and a run of mesh draws or dispatches with no plain draw in it is not cut; the frame rate measured the same.
RX_VK_SPLIT_BEFORE_DRAW=0turns it off; reverting the commit is enough.Reviewer notes
draw()then leaves out (no targets, a program not ready) still begins the part; exactness there would needdraw()to say whether it recorded. Not done without a measurement that needs it.RX_VK_CHUNK=100000(no parts) is also clean on this card, at 26-41 fps against 54-59.Issues
None filed yet for the shards.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md; no appended row or assembled view).mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Kokiri Forest while walking, Arc B580 (101.9154): twelve of the 25 frames with white shards in run V1 of the Measurements (353 frames,
RX_VK_SPLIT_BEFORE_DRAW=0, main's path). The same walk with the default showed none in 1,101 frames, so there is no picture of that side beyond an ordinary frame.The two test requests are open (T-GMJ7: Arc A-series or an Intel iGPU on Windows; T-VQXE: any Intel GPU on Linux) and named in the description. Both wait for a maintainer's testing wanted label.
WIP: fix(vk): Arc B580 no longer draws white shards while moving: a part ends only right before a plain drawto fix(vk): Arc B580 no longer draws white shards while moving: a part ends only right before a plain drawDescription: the box for the two updated checks (test_split_ub_flush.py, test_parallel_small_cb.py, both extended, neither weakened) added and ticked; a Linux build named under Not tested, since this PC has no Linux compiler.
The float-add fix this was measured on top of is open now: #444. A B580 needs it to reach Kokiri Forest at all, so a tester on that card wants both.
New runs outside the forest (four launches, the switch alternated; four more files in
docs/tested/, the description's Testing updated): Hyrule Field shows the same shards on main's path, 12 of 496 frames, and none with the default, 0 of 496. The Market: 1 of 236 against 0 of 156; its one flagged frame is a broken frame right after the arrival and may be something else. No device loss in either area.Test request T-GMJ7: mixed
Hardware: Intel Arc Graphics (the integrated GPU of a Core Ultra 9 185H laptop, shared memory), driver 32.0.101.9175, Windows 11 Pro 10.0.26300, 64 GB RAM.
Built
8ecee6d4b5, this pull request's head when I started (its base then was5e072fc8c2), as one Windows build used for every run. The game's own log names it v3.0.0-rc.3-66-g8ecee6d4b (source 97178958).What I checked: ten game runs of that one build in Kokiri Forest, alternating the switch:
RX_VK_SPLIT_BEFORE_DRAW=0(main's path) andRX_VK_SPLIT_BEFORE_DRAW=1(this pull request's path, the default on Intel). Nothing else differed. Every run started from the same autosave outdoors (the game wrote it after Link left the house; no save file was edited) and played the same 50 second input sequence: walking and turning on the paths between the houses, with camera centering off so the views stay comparable. Output 1280x720 in a window, frame generation off, no co-op, no audio.The shader caches were filled first by twelve warm-up runs (several were rejected for reasons that have nothing to do with this pull request, for example a cold first start that my own freshness check stopped after a one-second stall, and a route that began at the house door instead of outdoors; none of them is in the tables), then saved and put back in the same state before every run, so the walks are not spent compiling. One program (the same one each time) was still translated for the first time during the walk in three of the ten runs, V2, f2 and f3, taking 18 to 22 ms; that happened with both switch values.
Six runs, V1 to V6 (switch 0, 1, 0, 1, 0, 1), were for shards: during each walk the game took a picture of every frame it could, through its control bridge as in the pull request's description. That is just over half of the frames it presented. Each picture was counted with the description's rule (235 or more in red, green and blue, below the top fifth of the picture, 2,000 or more such pixels). I looked at every flagged picture, and at seven unflagged pictures from each run spread across the walk (42 in all).
Four more runs, f1 to f4 (switch 0, 1, 0, 1), were for the frame rate: no pictures during the walk, one after it, and the game's own
vi: ... frames presented (... fps over the last 5 s)lines read for the ten 5 second windows of the walk.Result, shards:
Result, frame rate (the four picture-free runs):
8ecee6d4b5. The pull request's current head,c8201e51d9, adds only run records under docs/tested; I compared the two by the public diff (the changed lines of every code and test file are identical), so this result carries to it. I did not run that head itself.Not tested: an Arc discrete card (A-series or B-series) or any other Intel GPU; Linux with Mesa (T-VQXE); frame generation (off in every run); other places than this Kokiri Forest walk (Hyrule Field, the Market) and walks longer than 50 seconds; shards during the four frame-rate walks (no pictures were taken during them); a larger frame-rate sample than two runs per switch; what the laptop's screen showed, because the pictures are the game's own captures and a shard that appeared only on screen and not in the capture would not be seen.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.