Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when changing device orientation on iOS #6

Closed
mtehver opened this issue Mar 11, 2020 · 2 comments
Closed

Crash when changing device orientation on iOS #6

mtehver opened this issue Mar 11, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@mtehver
Copy link

mtehver commented Mar 11, 2020

I seem to get a crash every time when I change my device orientation. The crash message is following (in MGLKitSampleApp):

-[MTLDebugRenderCommandEncoder setScissorRect:]:2702: failed assertion `(rect.x(0) + rect.width(2048))(2048) must be <= render pass width(1536)'

It seems that some internal state synchronisation is missing when the frame buffer size changes. I hit the same issue with my own tests also. I am testing using iPad Air 2, iOS 13.3.1.

@kakashidinho kakashidinho added the bug Something isn't working label Mar 11, 2020
@kakashidinho
Copy link
Owner

You are right, thanks. There is a bug. It's strange that the code can handle macOS's window resize but not iOS.

@kakashidinho
Copy link
Owner

One thing I noticed is that the crash is caused by the metal validation layer but this is actually a harmless crash, since the framebuffer will be correctly resized in the next frame. It is just that the immediate frame rendered at the moment the iOS's screen resize occurs will have incorrect size, hence metal validation layer complains and crashes the app immediately.
If you disable metal validation layer in the scheme settings, the crash won't happen anymore.
But I will fix this bug to make metal validation layer happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants