-
Notifications
You must be signed in to change notification settings - Fork 450
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 on old iOS devices when using FlxGraphicsShader for first time #2219
Comments
Could this be related to #2173? |
That looks like a different GPU/Android driver-specific issue. As the shader looks OK, I'd say the answer is probably picky/buggy drivers in both cases. |
Man, shaders are a mess... |
Are you going to create a pull request with the fix? |
I guess that's a no. :) |
Thanks for doing that, I'll make PRs instead in the future. FWIW I've shipped with it can confirm this worked on all iOS devices, but didn't try it on Android yet so that isn't as well tested (works on my Motorola G7 Play though). |
I wonder if you'll run into #2173. |
There is a crash on old iPhones/iPads when the graphics driver tries to compile/run this part of the FlxGraphicsShader fragment shader:
flixel/flixel/graphics/tile/FlxGraphicsShader.hx
Lines 30 to 67 in c302aaa
Observed behavior: On old iOS devices, Flixel apps always crash as soon as something is rendered. This doesn't repro on the iOS simulator. Testing a range of ~30 devices on a device farm, all the older ones crashed: iPhone 5 iOS 10.1, iPhone 5c iOS 9.1, iPhone 4S iOS 9.2.1, iPhone 5 iOS 10.0.2, iPhone 5c iOS 10.3.1, iPhone 5c 10.0.2. More recent devices seem to run fine, though my testing wasn't exhaustive.
Here's the stack trace. It's always the same, the first time any app renders any sprites:
Expected behavior: No more crashing.
I've restructured the fragment shader until it started working on the old devices. Given that the original shader works fine on newer devices (everywhere else), my changes are probably sidestepping some bug in the internals of the graphics driver/shader compiler:
I think the bit that makes the difference is changing the
if/else if/else
block from the original shader into separateif
statements.The text was updated successfully, but these errors were encountered: