fix(android): raise buffer-binding limits to adapter max (joint_bg crash) + v0.4.15#61
Merged
Merged
Conversation
The Android device was created from wgpu::Limits::downlevel_defaults() (which
caps max_uniform_buffer_binding_size at 16KB) merged only with .using_resolution
(which touches texture-dimension limits, not buffer-binding sizes). The renderer
binds a 64KB uniform buffer for joint matrices ('joint_bg'), so on real mobile
GPUs (e.g. Adreno) Device::create_bind_group aborts at init:
wgpu error: Validation Error
In Device::create_bind_group, label = 'joint_bg'
Buffer binding 0 range 65536 exceeds max_*_buffer_binding_size limit 16384
Desktop (linux/macOS) uses Limits::default() (64KB binding), so it never hit
this. Raise the uniform/storage buffer-binding sizes (and bind-group count) to
the adapter's reported maximum — guaranteed-supported, matching desktop.
Verified: cargo check --target aarch64-linux-android passes; a Perry Android
build now launches + renders on an Adreno device instead of SIGABRT at init.
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.
Problem
Perry-built Android apps crash at init with SIGABRT:
The Android device is created from
Limits::downlevel_defaults()(uniform binding cap 16KB) merged with.using_resolution()(which only updates texture-dimension limits). The renderer's joint-matrix bind group binds a 64KB uniform buffer. Desktop usesLimits::default()(64KB), so it never reproduced there.Fix
After the downlevel merge, raise
max_uniform_buffer_binding_size,max_storage_buffer_binding_size, andmax_bind_groupsto the adapter's reported max (guaranteed-supported; matches desktop limits).Verification
cargo check --target aarch64-linux-androidpasses. Confirmed end-to-end: a Perry Android build of Bloom Jump now launches and renders on a physical Adreno device instead of aborting at init (root-caused via an on-device panic→logcat hook; the failing R8/gralloc lines in logcat were unrelated driver noise).Bumps to v0.4.15.