WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reach #1877
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
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
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1877
Loading…
Reference in a new issue
No description provided.
Delete branch "Jiro113/Longshot:fix/grass-lists"
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?
Summary
Builds on #1382 (Grass distance, by winterelfeas): its two commits are here under their name, ported onto current
main(
9dd41326; the one conflict was the row's place indocs/user/graphics-and-controls.md), then commits of mine.Stays WIP until #1382 merges (this then rebases onto
mainand is only the last commit), and until the larger lists' safety and rendering issues are fixed.The bug, with #1382: Grass distance 3x and up, in Hyrule Field, standing still: whole patches of short grass come and
go from one frame to the next. Where the grass is thickest 2x (the former row's default) overflows too: standing where a field
save loads, 2x asks for about 196000 to 200000 blades (below), and patches are missing there as well.
Why: the game's grass programs hold a fixed number of records: the blade list of
d5a9475f2790532eholds 143360blades (8-byte records), each of
3de6d86ec7e6720e's two pools 138240 records of 48 bytes. Past 2x the grass asksfor more than that (about 406000 to 415000 blades at 4x, below), so which patches get a place is decided by the order the
GPU's threads reach the counter, and it changes every frame.
The change: an IR pass (
ir_opt/grass_pool_pass.h) is intended to move those records to larger storage buffers of the renderer's own (524288 blades, 393216 records in pool 2, about 4 MB and 18 MB each) and raise the caps in the producers and mesh programs that read them. The 64-byte headers stay in the game's buffers. The pass is disabled on all renderers while producer and reader matching, private buffer lifetime, allocation failure and the compute fallback's rendering are addressed. Grass distance is held at the game's reach;RX_VK_GRASS_DISTANCEandRX_VK_GRASS_POOLScannot enable larger distances or lists.Read first:
gpu/vk/eden/shader_recompiler/ir_opt/grass_pool_pass.h(the pass),vk_draw.cppgrass_private_binding(the buffers, found by the guest address the game's descriptor names),
vk_shader.cppgrass_pools(where it runs).Testing
Tested: Windows 11, RTX 4090, NVIDIA 621.24, this branch's pack (
dev.py pack/rt): the headdefe0217on main @9dd41326, and before the rebasebb0845b6on main @89c3d21e(Measurements, and the full check run below).In the game, on
defe0217: Hyrule Field, child, standing where a field save loads (facing the castle), the same packevery run, window behind and muted, 5 frames of
RX_VK_DRAW_STATSeach. The columns are3de6d86ec7e6720e's (it readsthe blade list
d5a9475f2790532emakes, one thread a blade: the threads it ran, and the countd5a9's counter askedfor), and the shots' near-white pixels (6 shots 0.5 s apart, the ground left of the map):
RX_VK_GRASS_POOLS=0(#1382 as it is)RX_VK_GRASS_POOLS=0RX_VK_GRASS_POOLS=0The compute fallback is forced with
RX_VK_FORCE_MESH_FALLBACK=1: the path the Steam Deck and every RADV GPU take bydefault (#1946), and Windows RDNA 2's task + mesh draws.
With it off, two thirds of the blades asked for at 4x are dropped (more than a quarter at 2x here), and which ones changes
from frame to frame: that is the flicker; on the shots whole parts of the slopes are bare. In that run with it on every blade asked for was processed, none was lost (
0 lost), and the slopes were full. Pool 2 holds about 334000 to 341000 records at 4x(the game's 138240, now 393216; measured at
bb0845b6).Not right yet: the compute fallback at 4x. With this PR the grass is full there too, but some blades are drawn white
(the last column: 5 to 8 % of the ground). Not at 2x, not with
RX_VK_GRASS_POOLS=0, not with mesh shaders. The causeis not found yet; this stays WIP until it is fixed.
Checks:
tests/test_grass_pools.pyexercises the pass on synthetic programs shaped as the game's (tests/grass_pools_ir.cpp): the three kinds made larger, pool 2's records written at the same place in the new buffer, and variants that differ a little left as they are. It also checks thatvk_shader.cpp's production gate leaves programs unchanged with the switch unset, 0 or 1. It can't failon
mainfor the bug's reason (the bug is in the game's own programs, the pass is new code), so the test lands with thefix; the bug on
mainis shown in the game below. Atdefe0217, undoing each key part of the pass (8 of them: the pool cap, theIAdd64 #8form, the blade reads, the blade guards, the table check, the guard order, the switch, the private flags) made it fail. That run used clang++ only:g++on this PC is clang; no GCC run.On
defe0217, the 244 checks that read the changed files (python -I -B tests/run_all.py --changed, then the same nameswith
--exacton an exported copy ofmain@9dd41326): here 217 passed, 27 failed; onmain210 passed, 32 failed(the two grass checks are not there). Every check that fails here fails on
maintoo:test_recording_admission.pypassed once in
main's batch, and fails on both when run alone (5 runs of 5 each). The checks that read the changedfiles pass:
test_grass_pools.py,test_grass_distance.py,test_handle_table_arrays.py,nx2/test_cbuf_table_extent.py,test_menu_ini_keys.py.Linux: defe0217's renderer (
RX_VK_ONLY=1 nx2/build.py --standalone, tools.lock's clang) built in WSL 2, Ubuntu 22.04:0 failed. No Linux run in the game (no GPU there).
The whole run, at
bb0845b6on main @89c3d21e:python -I -B tests/run_all.pyon this branch: 750 passed, 71 failed, 62 skipped; onmain@89c3d21e(an exportedcopy) on the same PC: 747 passed, 72 failed, 62 skipped. Every check that fails here fails on
maintoo (tools,compilers and stand-ins this PC lacks);
mainalso failsbyte_compile_tracked.py, which needs a git checkout theexport isn't. Failing on both:
test_vbytes.py(a 600 s timeout),test_appimage_player_build.py,test_auto_handheld.py,test_bug_report.py,test_bug_report_defaults.py,test_build_long_paths.py,test_capture_read_once.py,test_capture_readback_visibility.py,test_crash_dialog.py,test_crt_options.py,test_damage_debug_menu.py,test_dev_ab.py,test_dev_build.py,test_dev_migrate.py,test_dev_packs.py,test_discover.py,test_display_startup_failure.py,test_dlss_feature_size.py,test_draw_binds.py,test_draw_stream_visibility.py,test_early_split_before_draw.py,test_failed_compile_keeps_objects.py,test_frame_overlap.py,test_fsr_image_retirement.py,test_fsr_uniform_ownership.py,test_game_menu_mouse_buttons.py,test_guest_imported.py,test_high_fps_fixes.py,test_hold_gpu.py,test_host_guest_writes.py,test_hud_layout_row.py,test_job_queue.py,test_libc_hooks.py,test_lift_cache.py,test_lift_lookups.py,test_linux_preflight.py,test_linux_pressure.py,test_low_vram_texture_mips.py,test_make_game_cache.py,test_make_game_ngx.py,test_mise_build.py,test_missing_nup.py,test_mods_list.py,test_ngx_sdk.py,test_pads_after_menu.py,test_pass_barrier.py,test_pending_guest_import.py,test_pipeline_play_cache.py,test_prepare_cache_save.py,test_present_queue_default.py,test_present_source_crop.py,test_profiling_mode.py,test_psychov35_fsr3_fg.py,test_readback_early.py,test_readback_late.py,test_readback_timeout_source.py,test_recording_admission.py,test_replay_write_order.py,test_sampler_admission.py,test_sdiv_overflow.py,test_slow_frames.py,test_song_note_cue.py,test_split_before_draw.py,test_staging_burst.py,test_texel_buffer_ownership.py,test_ub_update_batch.py,test_upscaler_rows.py,test_vcore_escape.py,test_vk_occlusion_queries.py,test_walk.py,test_walk_key.py. The checks that read the changed files pass:test_grass_pools.py,test_handle_table_arrays.py,nx2/test_cbuf_table_extent.py,test_menu_ini_keys.py.Still to test:
2x and 4x, standing still, expecting the grass steady and green, and
vk: grass: program ...: ... made largerlineswith no
left as it is(@Beanstalkonce #1382 is in).@Beanstalk).Measurements
Measured at
bb0845b6on main @89c3d21e, before the rebase; to be measured again on the final rebase.Verdict: at 4x, -8.9 % fps (89.3 against 98.0, +1.07 ms a frame), every run below every run of #1382 as it is:
the cost of drawing every blade 4x asks for (about 2.9 times as many as the game's list kept). At 2x (the default), within the runs' spread (-1.9 % fps, +0.20 ms), though each
pair's run of this PR was the slower one.
Setup: Windows 11, RTX 4090, NVIDIA 621.24; Hyrule Field, child, standing where a field save of mine loads (facing
the castle;
dev.py ab --scene kokiri-house --save <that save>, so its text below says "Link's house": the scene is thesave's, no teleport. The
hyrule-fieldscene lands in the tunnel from Kokiri Forest, about 5500 blades, below thegame's caps); window 2560x720, output 5120x1440, every menu row at its default (resolution Auto, DLSS Game's own,
frame generation and V-Sync off), uncapped (
HOS_FPS_MAX=1000);RX_VK_GRASS_DISTANCEset for both sides (over therow's 2x); 60 s each after the warm-up, 3 interleaved pairs, the median;
dev.py ab --env RX_VK_GRASS_POOLS=0.Baseline: one build both ways, this branch (main @
89c3d21e+ #1382's two commits + this one): "Before" isRX_VK_GRASS_POOLS=0, #1382 as it is;mainhas no Grass distance, so no 4x to compare with.What holds the frame there (one profiled run, 4x, this PR, 75 s in the field): 11.7 ms a frame, GPU 8.5 ms,
the render thread's jobs 9.1 ms (draw translation 5.5 ms); the blade list's producer
d5a9475f2790532e0.08 ms ofGPU, the pools' producer under 0.08 ms. The frame is GPU- and replay-bound, so more blades drawn is more time.
Grass distance 4x (
RX_VK_GRASS_DISTANCE=4):bb0845b69bb0845b69Grass distance 2x (the former row's default), the same setup:
bb0845b69bb0845b69Within the runs' spread, but each pair's run of this PR is the slower one (by 1.4 to 2.5 %): treat it as up to about
0.2 ms a frame at 2x, not as nothing. The blade counts at 2x were not logged in these runs; on
defe0217(Testing) thesame spot at 2x asks for about 196000 to 200000 blades, so #1382 as it is keeps 143360 of them and this PR draws them
all: part of that 0.2 ms is the grass that was missing.
dev.py abwrote nomeasurements.mditself: it compares every switch the runs set, andHOS_CONTROL(the controlbridge's pipe, a new name each run) differs in every run driven through the bridge. The table above is its own
write-up (
ab.measurements) from the saved runs with that one name left out; nothing else differed.Risks
drawn white (Testing), seen with
RX_VK_FORCE_MESH_FALLBACK=1on the RTX 4090; not at 2x. Cause not found yet; to fixbefore this leaves WIP.
RX_VK_GRASS_POOLS. The translator's stamp distinguishes the disabled path.longshot_options.ini.Checklist
Ready for review
main; the title is a Conventional Commit. (on main @9dd41326, but #1382's two commits arehere until it merges)
mise run testpasses (any failure that also fails onmainis named). (final head pending)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.(the program keys and sizes were read from the game's shader IR on this PC; nothing of it is committed)
When it applies
mainand passes here. (to settle: it can't fail onmainfor the bug's reason; thebug on
mainis shown in the game, Testing says why)gpu/vk/switches.def. (larger lists and distances are disabled)tests/that reads changed source is updated, not weakened.(defe0217's tree: the pack on Windows with llvm-mingw, the renderer on Linux in WSL 2 with tools.lock's clang; the
change handles no path)
(#1382's commits: Grass distance in
docs/user/graphics-and-controls.md;RX_VK_GRASS_POOLSis a kill switch, its rowin
gpu/vk/switches.def)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
The main grass (Hyrule Field's) gets its blade count per ground tile from compute d5a9475f2790532e: the density times 1 - (1 + w97 - w96 / d^2), so full to sqrt(w96) (8 m), then falling as 1 / d^2 to none at sqrt(w96 / w97) (65 m). The game's own foliage setting for it (the foliage object's +0x7c) moves both words together; the row now multiplies both by n^2, so the full count reaches n times as far and the end stays at 65 m. The compute runs when the game makes a tile, so a change of the row reaches the main grass as Link moves on or the area loads again. grass_words gives each word the power of the reach it is multiplied by; each changed word is logged once ("vk: Grass distance ..."). Measured in Hyrule Field by the Kakariko gate: the blades in the middle distance 30 to 48 % more at 3x, as the game's own +0x7c = 24 gives; GPU +0.35 ms a frame at 4x on an RTX 5090 at 1440p, 2x within the noise. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit095a64343b) Ported onto main89c3d21efrom #1382 (095a6434) by Lucas Lebbrecht: the row's new help in gpu/vk/menu/grass.cpp.Above 2x the short grass asks for more blades than the game's lists hold (143360 blades in d5a9475f2790532e, 138240 48-byte records in each of 3de6d86ec7e6720e's two pools): which patches get in changes from frame to frame, and whole patches of grass come and go in Hyrule Field, even standing still. An IR pass (ir_opt/grass_pool_pass.h) moves the records to storage buffers of the renderer's own (524288 blades, 393216 records in pool 2) and raises the caps in the producers and the mesh readers; the 64-byte headers stay in the game's buffers. 3de6's pool-2 writes are taken in both forms the program has (the record's address, and that address + 8). Every edit is checked first; a program that does not look as expected is left as it is and logged ("vk: grass: program ...: ... left as it is: <why>"). RX_VK_GRASS_POOLS=0 leaves the programs as they were. The renderer's buffers are found by the guest address the game's descriptor names (vk_draw.cpp grass_private_binding). A line every 600 frames, when it changed, counts the lookups over the run ("vk: grass: frame N: ..."), and the binding log stops at 64 lines. tests/test_grass_pools.py runs the pass on synthetic programs shaped as the game's (tests/grass_pools_ir.cpp): the three made larger, pool 2's records at the same place in the new buffer, eleven that differ a little left as they are, and vk_shader.cpp's grass_pools both ways (unset, and RX_VK_GRASS_POOLS=0). Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11, RTX 4090, NVIDIA 621.24, Hyrule Field from a field save, standing still at Grass distance 4x: with RX_VK_GRASS_POOLS=0 the blade list holds 143360 blades every frame of ~415800 asked and patches of grass come and go; with this PR all of them are processed (405350-415646 asked, the same drawn), 32 grass programs made larger, 0 left as they are, no flicker in 6 shots 0.5 s apart. dev.py ab at 4x and 2x, 3 pairs each (Measurements).
bb0845b698defe021701Rebased onto main @
9dd41326(headdefe0217): #1382's two commits ported again under winterelfeas's name, the one conflict the Grass distance row's place indocs/user/graphics-and-controls.md. Built again: the pack on Windows, the renderer on Linux (WSL 2, Ubuntu 22.04), so the Linux box is ticked. The checks that read the changed files fail nothingmaindoes not.Checked again in the game on the rebased head (Testing has the table), which turned up two things:
RX_VK_FORCE_MESH_FALLBACK=1on the RTX 4090: 5 to 8 % of the ground near-white, against 0.1 % at most withRX_VK_GRASS_POOLS=0, with mesh shaders, or at 2x). That is the Steam Deck's and every RADV GPU's path, so this stays WIP until it is fixed (Risks).Also corrected in Testing: the 143360 threads are
3de6d86ec7e6720e's (it reads the blade listd5a9475f2790532emakes), notd5a9's. The measurements are still those ofbb0845b6on main @89c3d21e; they will be taken again on the final rebase.Dependent follow-up proposal: #2093 keeps this PR's
78c072cefoundation with Lucas's authorship, then adds measured adaptive sizing and the per-area/global six-row settings page. It is intended as a follow-up, not a competing buffer fix. #2093 remains WIP and will drop/rebase duplicate prerequisite work if this PR lands first.@rebase
I didn't rebase this pull request: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The files were left unchanged. Nothing was pushed.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
WIP: fix(vk): the grass's lists made larger, so Grass distance 3x and up stops flickeringto WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reachRecommendation: Request changes. The enlarged lists remain disabled, so the overflow and flicker fix does not run. The compute fallback defect and the base-branch conflict also remain unresolved.
What
@fixchangedI changed this pull request: the new head is
f3196b9963. I couldn't bring it up to date withmain: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list; the pull request increases that density. The author must decide whether and how to enable the change despite that risk. Files were left as they were. I edited its description and retitled it “WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reach” to match the change.Changed
Changed in part (the rest is for the author)
Not done
Nothing was built or run: the checks run again on the new head.
The current code holds grass at the game's reach and disables the unsafe enlargement path. That avoids exposing the known defects, but players do not get the advertised larger-distance fix, and the dormant implementation adds complexity.
Before merging, for the author (4) (a run, a measurement or a decision; it doesn't hold the recommendation)
gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. (@fixcouldn't: gpu/vk/vk_shader.cpp:1337 still disables the pass globally; the fallback's incorrect data or synchronization has not been diagnosed or corrected, and corrected output has not been verified in game.)gpu/vk/vk_menu.h: The default now uses the game’s distance. Measure the final head at the default and game’s distance on affected tier-1 hardware, including frame times and VRAM, before settling a broader default.gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. (more on the line) (@fixcouldn't: gpu/vk/vk_shader.cpp:1337 still returns false for every renderer. A coordinated, safe enlargement path has not been restored.)Checks: they run again on this head; a failure shows on the pull request.
Also noticed (5; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven for the current head. Earlier Windows RTX 4090 runs showed all requested blades processed with the pass enabled, but also showed white blades on the compute fallback; those runs do not demonstrate the disabled path fixing flicker.
Other systems: The enlargement gate applies to all renderers, including RADV, Steam Deck and Intel. The reported Linux build and Windows game runs were on an earlier head; final-head game and hardware coverage is pending.
Switches: RX_VK_GRASS_DISTANCE is ignored and reach is fixed at the game's distance. RX_VK_GRASS_POOLS is disabled regardless of its value. These defaults avoid the known unsafe path but do not provide the intended feature.
Reviewed:
f3196b9963against9dd41326e7: Read the repository rules and pull request template, the relevant diff and current grass menu, gate and test code; inspected references to private storage and the recorded runs. The full large renderer and shader pass files, generated files and translations were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. CI has not yet run on this head; the supplied game, build and check results are from earlier heads.
Overlaps and merge order: #1382 is a prerequisite; #2093 is described as a dependent follow-up that should drop or rebase its duplicated foundation after this pull request lands.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@ -1333,0 +1334,4 @@// Keep the whole pipeline on the game's lists until producer/reader matching, private buffer lifetime and allocation// failure can be coordinated, and the compute fallback's rendering is corrected. A partial pass is unsafe.bool grass_pools_on() {return false;L8: Returning false for every renderer disables the entire advertised flicker fix. At 4x in Hyrule Field the game still caps the list at 143,360 blades while requesting roughly 416,000, leaving patches missing and flickering. Restore a coordinated, safe enlargement path that fixes the overflow before offering the affected distances.
@fix
Nothing needed changing: the review's items are already done. I couldn't bring it up to date with
main: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list, and its test checks that behavior. The pull request changes that same grass. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were.Not done
For the author (no edit does these)
gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game.gpu/vk/vk_menu.h: The default now uses the game’s distance. Measure the final head at the default and game’s distance on affected tier-1 hardware, including frame times and VRAM, before settling a broader default.gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances.Nothing was pushed.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
Recommendation: Request changes. The enlarged-list pass remains disabled, so the proposed overflow and flicker fix does not run. The compute fallback’s white-blade defect also remains unfixed.
What
@fixchangedI changed this pull request: the new head is
431b93612f. I couldn't bring it up to date withmain: resolving the conflict in gpu/vk/vk_draw.cpp, tests/test_grass_distance.py needs the author: The base branch deliberately keeps Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; this pull request restores that increase. The author must decide whether to accept that risk or revise the feature. The files were left unchanged. I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change holds grass at the game’s reach and disables enlarged lists, avoiding the known unsafe path. It adds the groundwork for larger lists but does not yet deliver the advertised flicker fix.
Before merging, for the author (3) (a run, a measurement or a decision; it doesn't hold the recommendation)
gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. (@fixcouldn't: grass_pools_on() in gpu/vk/vk_shader.cpp still returns false globally; the fallback’s incorrect data or synchronization has not been found or fixed.)gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances. (@fixcouldn't: gpu/vk/vk_shader.cpp still disables the pass for every renderer; a coordinated, safe enlargement path has not been restored.)Checks: they run again on this head (
Guide screenshots / Guide images and local UI source review (pull_request)failed on the last one); a failure shows on the pull request.Also noticed (9; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven for the current code: the recorded game runs exercised an earlier head with enlarged lists enabled. At 4x, those runs showed full grass but also white blades on the compute fallback; the current pass is disabled.
Other systems: The disabled pass applies to all renderers, including RADV, Steam Deck and the compute fallback. Linux, AMD and Intel game runs remain outstanding for an enabled fix.
Switches: RX_VK_GRASS_DISTANCE is ignored and reach is fixed at 1x. RX_VK_GRASS_POOLS cannot enable the pass. These defaults avoid the known unsafe path but do not provide larger distances.
Reviewed:
431b93612fagainst9dd41326e7: Read AGENTS.md, CONTRIBUTING.md, grass.cpp, test_grass_distance.py and the new source-review note in full; inspected the relevant shader and draw paths, the fix commit, the manifest changes and the recorded results. The remaining changed code and generated manifest were skimmed, not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The supplied CI status says checks have not yet run on this head; the reported game and build results are from earlier heads.
Overlaps and merge order: #1382 is a prerequisite; merge it first and rebase. #2093 is a dependent follow-up intended to drop duplicate prerequisite work after this PR lands.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@fix
There is nothing for an edit to fix on this pull request. I couldn't bring it up to date with
main: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; the pull request increases that density. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were.For the author (no edit does these)
gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game.gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances.Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
There is nothing for an edit to fix on this pull request. I couldn't bring it up to date with
main: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The pull request also describes extending Hyrule Field grass, while the base branch retains its density to avoid overflowing its fixed blade list; the author must decide the intended behavior.For the author (no edit does these)
gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game.gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances.Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Closing: superseded by #2093, merged as
1885234b2. #2093 carried this PR's commit (the grass's lists made larger,4519904e3there) and added what the reviews here asked for:StorageBufferLength), so a buffer that could not be made leaves the programs on the game's buffers at the game's caps;The compute fallback's white blades at 4x (L1) came from the fallback's records area and were fixed by #2121 (
8fa2313a4).Hyrule Field's grass reach is now set on the Simulated turf page. On
main,gpu/vk/grass_distance.hleaves it to that page on purpose, so bringing it back under Grass distance here would give the same grass two controls.This branch has nothing that
mainlacks: BeanBot's gate (f3196b996) and its guide note (431b93612) were for this pass, which is now onmainin #2093's form.Pull request closed