Skip to content

iOS build crashes on camera pan #15960

Open
@kraftwer1

Description

@kraftwer1

Bevy version

0.14.2 and also on master (#15953).

AdapterInfo { name: "Apple iOS simulator GPU", vendor: 0, device: 0, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Metal }

What you did

Attempting to pan the camera towards right by incrementing translation.x =+ 0.5 in Update.

What went wrong

It crashes on both iOS Simulator (newest iPhone 16 with newest iOS 18) as well as on real hardware (also tested on iOS 18). The error message is the same on both:

-[MTLDebugComputeCommandEncoder dispatchThreadgroups:threadsPerThreadgroup:]:1293: failed assertion `(threadgroupsPerGrid.width(0) * threadgroupsPerGrid.y(1) * threadgroupsPerGrid.depth(1))(0) must not be 0.'

But it's not limited to the camera. It also crashes when moving the cuboid. Also note that everything works fine on macOS. It even works fine on iOS when the app is started regularly from the homescreen (as opposed to starting it using the Xcode play button).

Additional information

To reproduce:

  1. Clone the Bevy repo
  2. In examples/mobile/src/lib.rs add a system that pans the camera (see snippet below)
  3. Start Xcode and open examples/mobile/bevy_mobile_example.xcodeproj
  4. Hit the play button, it will crash after a few seconds
// Don't forget to add it like .add_systems(Update, pan_camera_right)
fn pan_camera_right(mut camera_transform: Single<&mut Transform, With<Camera3d>>) {
    println!("x is {}", camera_transform.translation.x);
    camera_transform.translation.x += 0.05;
}

Note that it also fails when decreasing, and also on the x and z axis (at least in one direction).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorO-iOSSpecific to the iOS mobile operating systemS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions