diff --git a/native/android/src/lib.rs b/native/android/src/lib.rs index e5b89e8..c90d60a 100644 --- a/native/android/src/lib.rs +++ b/native/android/src/lib.rs @@ -184,8 +184,21 @@ pub extern "C" fn bloom_init_window(width: f64, height: f64, title_ptr: *const u } else { wgpu::ExperimentalFeatures::disabled() }; + let adapter_limits = adapter.limits(); let mut required_limits = wgpu::Limits::downlevel_defaults() - .using_resolution(adapter.limits()); + .using_resolution(adapter_limits.clone()); + // The renderer's `joint_bg` binds a 64KB uniform buffer, but + // downlevel_defaults caps uniform-buffer bindings at 16KB, so + // create_bind_group panics on mobile GPUs (e.g. Adreno) with + // "range 65536 exceeds max_*_buffer_binding_size limit 16384". Raise the + // buffer-binding sizes (and bind-group count) to the adapter's maximum; + // these are guaranteed-supported and match the desktop limits. + required_limits.max_uniform_buffer_binding_size = + adapter_limits.max_uniform_buffer_binding_size; + required_limits.max_storage_buffer_binding_size = + adapter_limits.max_storage_buffer_binding_size; + required_limits.max_bind_groups = + required_limits.max_bind_groups.max(5).min(adapter_limits.max_bind_groups); if required_features.intersects(rt_mask) { required_limits = required_limits .using_minimum_supported_acceleration_structure_values(); diff --git a/package.json b/package.json index ab77a80..8b12e74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bloomengine/engine", - "version": "0.4.14", + "version": "0.4.15", "description": "Bloom Engine: native TypeScript game engine compiled by Perry", "main": "src/index.ts", "types": "src/index.ts",