Repository navigation
vulkan: enable compute dispatch barrier chaining in Android gcopy_mode - #508
Merged
Merged
Conversation
Tracks owed post-store compute barriers (dchain_after) across chained dispatches, image-writing shaders, and gcopy_mode storing dispatches so independent dispatches skip redundant vk_full_barrier drains while flushing owed barriers before non-dispatch commands, copy-backs, or vk_submit_extra.
Propinbo
added a commit
to Propinbo/BOTWRecompAndroid
that referenced
this pull request
Nov 20, 2026
…, v0.4.7-beta-mali rollout & decal probe
Owner
|
Thanks! Tested on the POCO in copy mode (LARECOMP_VK_HOST_IMPORT=0, LARECOMP_VK_NO_PLACED=1) and the default path: 422 of 1164 dispatches chained in copy mode (0 with LARECOMP_VK_DISPATCH_CHAIN=0), the same GPU time and frame p99 in all three, no errors. Merging. |
Propinbo
added a commit
to Propinbo/BOTWRecompAndroid
that referenced
this pull request
Nov 20, 2026
… merged, v0.4.8-beta triage [skip ci]
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.
Summary
Enables compute dispatch barrier chaining (
dchain) in Androidgcopy_modeand defers owed post-dispatch barriers (dchain_after) across chains of compute dispatches until the run ends,gfast_prepare()copies, or submission finishes.Key Changes (
runtime/nvn/vulkan/exec.c)dchain_after:!gcopy_moderestriction sodchain = !gfast_n && vk_cmd() == cb && dchain_ok()works in Android copy mode too.dchain_aftertracking: when a storing dispatch (uses_gmem_storeorcs_writes_image(), including!gcopy_modegfastfallbacks when!gfast_handled) is chained or followed by another dispatch / non-GPU op (dchain_keeps()), thevk_full_barrier()is owed (dchain_after = true) rather than emitted eagerly between consecutive dispatches.dchain_afterbarrier in:exec_list()before any non-dchain_keeps()command (if ((dchain || dchain_after) && ...)),vk_submit_extra()before command buffer completion,gfast_prepare()beforecopy_buffer(cb, gmem_buf, gfast_buf, ...),dchain_afteringfast_finish()/gres_get()after their ownvk_full_barrier(cb).dchain,dchain_after,dchain_cb,dchain_env,gwin_mode, andgfast_winacross reboots invk_exec_reset()(and clearsgfast_winingcopy_prepare()).tools/test_rt_load_upload.c):cs_writes_image()+ plain dispatches,gcopy_modestoring dispatch chains,dchain_after-onlyCMD_BARRIER,vk_submit_extra()flush,LARECOMP_VK_DISPATCH_CHAIN=0, plain 0-barrierCMD_BARRIER,!gcopy_modem==0fallback,gfast_n > 0pre-copy barrier ordering, andvk_exec_reset().Rollback / Zero-Overhead Guarantee
LARECOMP_VK_DISPATCH_CHAIN=0disables dispatch chaining cleanly.gcopy_modebuilds and non-compute command streams retain priordchainbehavior (with an addeddchain_afterreset on reboot).Isolated On-Device Verification (Exact Commit
7845d58)Environment: Galaxy Tab S11 (
SM-X730), Android 16,Mali-G925-Immortalis MC12(vendor 0x13b5,device 0xd8300010,driver-id 9,v1.r49p1-03bet0.f8a98b506b89b21c80a508d70abfcb3f), BOTW1.9.0, upstream base2c72f20(v0.4.7-beta), commit7845d58, USB-powered (plugged: 2, no off-charger power claims made).1. Official 30 FPS
benchmark.cA/B (warmup_s=8,calm_s=3,window_s=10, 301 frames/scene)zora-plazaLARECOMP_VK_DISPATCH_CHAIN=0)30.0029.4233.95 ms27.03/33.82 ms18.80/21.60 ms6.31 mszora-plaza30.0029.4733.87 ms27.31/33.74 ms19.02/21.54 ms6.02 mskakariko-dayLARECOMP_VK_DISPATCH_CHAIN=0)30.0029.3533.97 ms27.55/32.27 ms19.60/22.70 ms5.78 mskakariko-day30.0029.2734.01 ms27.50/33.50 ms20.25/23.67 ms5.84 ms2. Uncapped 60 FPS Steady-Camera
[vk]A/B (LARECOMP_FPS=60, 2s[vk]intervals with0 skipped, compile 0duringS_WARMUP)(Note: upstream
benchmark.c:810exitsS_WINDOWat non-30 FPS targets, so these are steady[vk]2s-interval metrics beforeS_WINDOWexit.)max mszora-plazaCHAIN=0)743.80/43.7131 ms4013.9/0.00.0%zora-plaza644.85/44.5531 ms3978.2/1190.3+1.05 fps / +2.4%)kakariko-dayCHAIN=0)337.10/37.2041 ms2727.7/0.00.0%kakariko-day736.90/37.0032 ms2780.6/1251.1worst max -9 ms, GPU-bound FPS neutral)Verbatim
[vk]sample (zora-plaza):[vk] t=41.1 frame 1488 43.5 fps max 27ms level - (311900 draws, 0 skipped, 16512 passes, 3881 dispatches (0 chained), 728 flushes, wait 33ms, compile 0 (waited 0ms), ...)[vk] t=40.9 frame 1520 43.2 fps max 28ms level - (311806 draws, 0 skipped, 16475 passes, 3847 dispatches (1150 chained), 747 flushes, wait 18ms, compile 0 (waited 0ms), ...)Verbatim
[vk]sample (kakariko-day):[vk] t=81.6 frame 2889 37.1 fps max 31ms level - (402215 draws, 0 skipped, 13629 passes, 2717 dispatches (0 chained), 703 flushes, wait 15ms, compile 0 (waited 0ms), ...)[vk] t=81.1 frame 2904 36.7 fps max 32ms level - (396108 draws, 0 skipped, 13630 passes, 2628 dispatches (1110 chained), 698 flushes, wait 15ms, compile 0 (waited 0ms), ...)Visual Verification (
zora-plaza,gcopy_modeDispatch Chaining Active)Additional Unit & Build Verification
NDK 30):test_vulkan_compat.py(16 PASS),test_vulkan_startup.py(33 PASS),test_shader_cache.py(17 PASS),test_soft_linear.py(23 + 3 + 203 PASS).SM-X730,tools/test_android_runtime.ps1):7/7 PASSon7845d58(8/8 PASSon consolidatedb6ed7e0).:app:assembleDebug --no-daemon->BUILD SUCCESSFUL;-U__ANDROID__compiles with0new warnings.Tested vs Untested GPU Matrix
SM-X730,r49p1,gcopy_mode)7845d58:30 FPSA/B +60 FPSsteady[vk]A/B (29.9%–45.0%chained) + screenshot + Bionic tests!gcopy_mode/gmem_buf), Qualcomm stock, Mali< r49, Desktoptest_rt_load_upload.cmock synchronization validator (0 hazards) &LARECOMP_VK_DISPATCH_CHAIN=0rollback