Repository navigation
Conversation
Four overlapping bugs caused grass and foliage to flicker or disappear entirely on AMD's proprietary Vulkan driver (RX 6600, RDNA 2): 1. grid_patch_want: OoT's foliage culling chains write the *next* dispatch's group counts on the GPU within the same frame. grid_patch_want was only set for indirect==true, so direct dispatches whose counts were still GPU-written read stale (last-frame) bounds, causing the culling program to flicker geometry in and out each frame. Fix: set grid_patch_want unconditionally; RX_VK_NO_GRID_PATCH=1 opts out. 2. SSBO stretch default-on: the foliage task/mesh programs read 12-18 MB past the declared SSBO size word; when bound to only the declared size, reads past it return 0, culling every grass blade. RX_VK_SSBO_STRETCH=1 already existed as an opt-in. Make it default-on for read-only single-binding SSBOs in compute. RX_VK_NO_SSBO_STRETCH=1 opts back out. 3. guarded_compute -77 retry: on AMD's proprietary driver VK_ERROR_INITIALIZATION_FAILED (-77) is a compiler hang in the optimised path, not a true GPU fault; the unoptimised build succeeds. Previously -77 always blacklisted the pipeline immediately (unlike -13 which was retried). On VK_DRIVER_ID_AMD_PROPRIETARY, retry once without the optimizer before blacklisting. fault_retry_on() (RX_VK_FAULT_RETRY) already covered this manually; this makes it implicit on AMD. 4. build_graphics -77 retry: same as above for the graphics pipeline path. Added amd_prop_retry flag so -77 on AMD proprietary goes through the existing no-optimizer retry branch. Affected programs known to trigger these bugs on RX 6600: 6eaa646d07ea4e43, 9ef43d77b041f01d (foliage/grass culling shaders) Env vars: RX_VK_NO_GRID_PATCH=1 — disable grid_patch entirely RX_VK_NO_SSBO_STRETCH=1 — revert SSBO stretch to opt-in RX_VK_SSBO_STRETCH=1 — force SSBO stretch on (old opt-in, still works) RX_VK_FAULT_RETRY=1 — retry all -77 faults without optimizer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DLcQ6J6pKQztrA2UPk5Ldq
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.
I see how its meant to be formatted now
Claude assisted in diagnosing the issues
Bug
On AMD's Vulkan driver (tested on RX 5500), grass and foliage flicker or disappear entirely each frame.
Fix
grid_patch_wantis instead set unconditionally rather only whenindirect == true.Opt out
RX_VK_NO_GRID_PATCH=1.SSBO stretch (read-only single-binding compute SSBOs to the pool's end, up to 64 MB) is now default on.
Opt out
RX_VK_NO_SSBO_STRETCH=1.On
VK_DRIVER_ID_AMD_PROPRIETARY, a -77 result in bothguarded_computeandbuild_graphicsnow retries once without the optimizer before blacklisting.RX_VK_FAULT_RETRY=1already covered this manually.Why
All three issues are AMD driver-specific and interact with how foliage culling is structured. The grid_patch and retry changes only activate when something has already gone wrong and cannot make things worse. SSBO stretch reads within memory the process already owns (which is the same pool allocation), the worst outcome of an edge case is a minor visual glitch rather than a crash. All changes are opt-out with environment variables if a regression appears on another driver.