Skip to content

fix(android): raise buffer-binding limits to adapter max (joint_bg crash) + v0.4.15#61

Merged
proggeramlug merged 1 commit into
mainfrom
fix/android-buffer-binding-limits
Jun 9, 2026
Merged

fix(android): raise buffer-binding limits to adapter max (joint_bg crash) + v0.4.15#61
proggeramlug merged 1 commit into
mainfrom
fix/android-buffer-binding-limits

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Problem

Perry-built Android apps crash at init with SIGABRT:

wgpu error: Validation Error
  In Device::create_bind_group, label = 'joint_bg'
    Buffer binding 0 range 65536 exceeds max_*_buffer_binding_size limit 16384

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 uses Limits::default() (64KB), so it never reproduced there.

Fix

After the downlevel merge, raise max_uniform_buffer_binding_size, max_storage_buffer_binding_size, and max_bind_groups to the adapter's reported max (guaranteed-supported; matches desktop limits).

Verification

cargo check --target aarch64-linux-android passes. 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.

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.
@proggeramlug proggeramlug merged commit b723953 into main Jun 9, 2026
8 checks passed
@proggeramlug proggeramlug deleted the fix/android-buffer-binding-limits branch June 9, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant