Repository navigation
vk: handle UNIFORM_BUFFER_DYNAMIC in descriptor_plan - #537
Merged
Merged
Conversation
Propinbo
added a commit
to Propinbo/BOTWRecompAndroid
that referenced
this pull request
Nov 21, 2026
…fix & v0.4.10-beta-mali SM-X730 rollout
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
Fixes
descriptor_plan()inruntime/nvn/vulkan/exec.c(and alignstools/test_descriptor_plan.py) soLARECOMP_VK_DESCRIPTOR_PLAN=1handlesVK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMICbindings identically tostage_set()instead of dropping them and crashing in the driver.LARECOMP_VK_DESCRIPTOR_PLANremains off (0) by default — zero hot-path overhead and zero behavior change on any GPU unless opted in.descriptor_plan()parity and updatestools/test_descriptor_plan.py(which also missed#define CBPATCH_BUFFER_INDEX 23andVK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC).Root Cause
In
compile_program_from_spirv()(runtime/nvn/vulkan/exec.c), UBO bindings (1..16, then0, 18, 19, 20, 23) are promoted fromVK_DESCRIPTOR_TYPE_UNIFORM_BUFFERtoVK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMICup tomaxDescriptorSetUniformBuffersDynamicbeforemake_layout()callsdescriptor_plan().stage_set()accepts both descriptor types viais_ubo(b->type), butdescriptor_plan()checked onlyb->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFERin both its regular (binding < 17) and deferred (18, 19, GMAP_BUFFER_INDEX, CBPATCH_BUFFER_INDEX) branches — silently omitting every promoted dynamic UBO descriptor write whenLARECOMP_VK_DESCRIPTOR_PLAN=1was set.Additionally,
tools/test_descriptor_plan.pylacked#define CBPATCH_BUFFER_INDEX 23andVK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMICin its mock enum, boundary table, and reference loops.Changes
runtime/nvn/vulkan/exec.c(#ifdef __ANDROID__descriptor_plan()): match bothVK_DESCRIPTOR_TYPE_UNIFORM_BUFFERandVK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMICin the regular and deferred branches.tools/test_descriptor_plan.py: add#define CBPATCH_BUFFER_INDEX 23,VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC(6 descriptor types,boundary[]expanded to 12 entries including22and23), and dynamic UBO coverage in bothlegacyreference loops.Verification
Host & Bionic (
c27c1b7de86f)tools/test_descriptor_plan.py(NDK30.0.16248370wasm32 + Node):31040 descriptor-plan equivalence cases passed.tools/test_soft_linear.py(NDK30.0.16248370):23C checks +3GLSL->SPIR-V checks +2031/256 bilinear math checks passed.tools/test_vulkan_compat.py(16),tools/test_vulkan_startup.py(33),tools/test_gpu_timing_trace.py(8),tools/test_pipeline_cache_save.py,tools/test_workspace160_guard.py,tools/test_command_snapshot.py: all passed.tools/test_android_runtime.ps1on Galaxy Tab S11 (SM-X730):8/8Bionic tests passed.Physical Device (
SM-X730, Mali-G925-Immortalis MC12r49p1, Android 16 API 36, BOTW1.9.0)Tested in isolated scratch (
output=screen,resolution=1x,upscaler=sgsr1,shadows=1,frame_rate=30) on exact commitc27c1b7de86f:v0.4.10-beta1c02adf9,LARECOMP_VK_DESCRIPTOR_PLAN=1): black screen onplateau,2455GROUP_ERROR_FATALerrors,SIGSEGVinlibGLES_mali.so(0benchmark results).c27c1b7de86f,LARECOMP_VK_DESCRIPTOR_PLAN=1):plateau30.00 fps(1% low 29.48 fps,render_thread_ms p50 17.74) -> clean reboot (432 progs / 865 pipelines / 15 compute freed, 0 kept) ->zora-plaza30.00 fps(1% low 29.53 fps,render_thread_ms p50 18.69),0errors.c27c1b7de86f,LARECOMP_VK_DESCRIPTOR_PLANunset):plateau30.00 fps(1% low 29.45 fps,0errors), behavior unchanged.v0.4.10-beta,PLAN=1)plateau,PLAN=1)zora-plaza,PLAN=1)GPU Coverage Matrix
r49p1,SM-X730, Android 16)PLAN=1crash/black screen;0errors across scenes + reboot; default off unchanged31,040equivalence cases)stage_set()scanLARECOMP_VK_DESCRIPTOR_PLAN=1)#ifndef __ANDROID__)descriptor_plan()is compiled only under#ifdef __ANDROID__