-
Notifications
You must be signed in to change notification settings - Fork 986
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
WebGL performance significantly slower since iOS 15 #1246
Comments
I'm not well knowledgeable in this area, but thought I'd give a response since no one else did over the weekend. I'm fairly confident the experimental flags are not programmable. I've found several sources indicating that it can be changed using the I'll leave this ticket open for someone else that is more knowledgeable. Alternatively, you can try asking our Slack Community as well. |
You might want to try the following to see if it helps you out in anyway. Note, that the code is loading an external library for platform identification. If you are already using any pre-existing plugin or library that can identify the browser/device/version, then I would suggest modfying the code to use that instead. I added a comment to the top of the source code with the link to where it originated from. <!-- Code Original Source: https://github.com/flutter/flutter/issues/89655#issuecomment-936666189 -->
<!-- iOS 15 WebGL 2.0 fix (https://github.com/flutter/flutter/issues/89655) -->
<!-- TODO(your_username): Remove when https://github.com/flutter/engine/pull/29038 will be merged to stable -->
<script src="https://unpkg.com/platform@1.3.5/platform.js"></script>
<script type="text/javascript">
function isIOS() {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform)
// iPad on iOS 13+ detection
|| (navigator.userAgent.includes("Mac") && "ontouchend" in document)
}
if (isIOS() && parseInt(platform.os.version.split(".")[0]) >= 15) {
// iOS/iPadOS 15+
HTMLCanvasElement.prototype.getContext = function (orig) {
return function(type) {
return type !== "webgl2" ? orig.apply(this, arguments) : null
}
}(HTMLCanvasElement.prototype.getContext)
}
</script> |
Thank you for taking the time to answer to me. Unfortunately this doesn't fix the problem on my side. Webgl context is never using webgl2 on my testing setup so the issue is not caused by webgl2 |
Is it possible to test this in the real iOS Safari browser to determine if the issue also happens in the browser app? If the issue is not exclusive to WKWebView, then it would suggest that the issue is deep in the browser engine, and it's likely nothing that Cordova can do about it. I think you can also test your theory on |
Problem
Same game built with phaser is running at 60 fps on iOS 14 and 30 fps on iOS 15
it seems that it's due to an experimental feature set to "on" by default in 15.x: "GPU Process: Canvas Rendering", ref: https://developer.apple.com/forums/thread/684843
is there a way to change experimental features of wkWebview ?
The text was updated successfully, but these errors were encountered: