WebGL2 on some devices fails to display images (GL ERROR :GL_INVALID_OPERATION : glTexImage2D:)
Reported by
kyat...@gmail.com,
Jul 20
|
|||||||
Issue descriptionSteps to reproduce the problem: Find the reproduction APK at this address (it is more than 10 Mb) : https://bit.ly/2uVOfQT 1. Execute this debug APK on an alcatel U5 Android 6.0 Model number 5044D Core number 3.18.20 Build number 01006 2. The application executes but displays a white background with the log information (in a DOM textArea object) in front of it 3. The application is rendered unusable because of that What is the expected behavior? Images in the background to display, and then a pink hand appearing once the initialisation is done. What went wrong? According to the console, this error happens : [.Offscreen-For-WebGL-0x9a716000]GL ERROR :GL_INVALID_OPERATION : glTexImage2D: <- error from previous GL command Seems related to WebGL2 since a version that forces the use of webGL only does work as intended on the very devices the version using webGL2 fails. Did this work before? N/A Does this work in other browsers? N/A Chrome version: Version Chrome 67.0.3396.87 Channel: n/a OS Version: 6.0 (Windows 7, Windows Server 2008 R2) Flash Version: Shockwave Flash 27.0 r0 I'm using the software Construct 3 (https://www.construct.net) to build an application for Android and iOS. This software helps build the application in HTML 5 (JavaScript) and through Cordova helps compiling it wrapped to be executed as an APK on Android devices. I'm working with a team where I'm providing the HTML5 sources and they bring it in Android Studio, compiling them in their hybrid app that opens a WebView to execute the application. Note I'm getting the same issue when building the APK out of Construct through the provided build service that takes the exported project as a Cordova project and sends back an APK file. We have reached release period and on some various devices, our application does initialize, load the images required and during the init the images do disappear. On our development devices, we are not encountering the issue but have had at least 4 different reports of the same issue happening. The compiled application does execute a loader layout. In our "full" version (the provided APK is tuned down and does not contain most of our content) during the download of the images and the initialisation of the application's "engine" the images disappear on some Android phones (so far at least 3 in our tests), leaving only DOM objects (TextInput, Button) to appear on a white background. This renders the application unusable afterwards. The provided APK here does display the white background right away. The application works as intended on some phones. I've made this apk for you to test and hopefully manage to reproduce the issue. To be fair, on my phone and tablet, I can't reproduce. I've had the phone of a colleague though who reported the bug to us and suffers from it. We have had at least two more reports of the same issue on two other different phones. This version is made so it "skips" the hybrid app and works on its own. The issue does appear in this version, ruling out the build within the hybrid app as the possible cause. It is a debug APK and I inspect it with Chrome. Log messages are on screen of the application (in black) and in the console as well (some messages only appear in the console and not on screen). During the initialisation phase, after having loaded the pictures to execute the loader screen, the rest of the images starts to download (first counter in %). The "engine" does initialize as well. You can still click the (set to invisible through CSS) DOM button that allows to go to the "Screen Title" once the application is fully initialized (message : "Ampélograf est initialisé") in the log on screen and in the console. Nevertheless, since no image appears/"exists" it is not possible to navigate further. On a phone that works, there is nothing to be noted and the application works as intended. On the phone that does not work that I've debugged, once the loader layout starts being executed it displays this error message : [.Offscreen-For-WebGL-0x9a716000]GL ERROR :GL_INVALID_OPERATION : glTexImage2D: <- error from previous GL command A quick search lead me to believe this could be a WebView component bug : https://stackoverflow.com/questions/35705023/android-webview-performance-issue-gl-invalid-operation NativeScript/NativeScript#1936 There is nothing more to note, either in our compiled hybrid application when debugging with Android studio, either in this version when using the chrome:inspect. The disappearance of images does not display a message/error in the console. The phone that does not work is an Alcatel U5 Android 6.0 Model number 5044D Core version 3.18.20 Build number 01006 I was reported the same issue on a Samsung S7 (I don't know more of the specs at this time) and also another phone (model unknown) but that would execute Android 7.0 The Alcatel does show WebGL and WebGL2 support when going on : https://get.webgl.org/ http://webglreport.com/?v=2 We have had the HTML5 hosted version tested on the same telephone without this issue as well. Worth noting, we managed to "fix" the issue and have the application correctly executing on those phones by removing the webGL2 context render and forcing webGL only. On the other hand, we had test made on devices executing Android 5, 6 and 7 all working without this issue. I've even tested this APK on my Nexus 7 from back in 2012 I hadn't booted on in a while and is still on Android 5.1.1. The application is super slow, but this issue does not show up. I've also seen the application work on a "new" Sony Xperia (no clues on the software specs as well though). In Construct's forum, the same kind of issue has been reported on other applications as well.
,
Jul 20
Forum thread with more details: https://www.construct.net/forum/construct-3/general-discussion-7/force-webgl1-135173 This is also reported to affect Facebook Instant Games (which AFAIK run in a web view).
,
Jul 20
Worth noting: the case I'm presenting here is not a case of "black screen but showing form controls" I believe. The white background is the background of the layout (layer Background). The overall render context exists, and the application is executed as intended. What fails is the rendering of the quads containing the images on top of it. Since it fails/those do not exist and some act as buttons to navigate the application, the application will not go further. We have tested on an Android-TV device which displayed the original issue, and with the forced webGL renderer has a "blinking" issue (white background/images on top of it). This blinking does not appear on phones.
,
Jul 20
We'd like to triage this urgently. We do not have an Alcatel U5 in house. Can anyone confirm this on a reasonably recent phone - per original report, a Samsung S7 would be fine? Is this happening only in Construct compiled applications (e.g. WebView), or does it happen in Chrome as well? The rendering model of the browser is very different between the two.
,
Jul 20
Some sort of reduced test case is urgently needed as well. It's not clear to me that the APK attached in the bug report is that. If it only happens with Construct apps, source code for the app is needed as well. If it can be reproduced simply with a web page, that would be ideal.
,
Jul 20
It was reported to us that the issue did happen on a Samsung S7 and on a galaxy Note as well, I'll ask my team for further information on the exact devices (this might take a while, people asking other people who are possibly not tech-savy). I'd love to produce a web page that would reproduce the issue, but as mentioned, the HTML5 (web hosted) version did not reproduce that issue on the devices as far as we are aware. It only occurred once it went through Cordova compilation. I'll make a test with a web version and see if my colleague do encounter the same issue. The provided APK, for now, is the reducer test case I can provide. It has been tested and proves to fail on the device, showing the white background on the failing devices.
,
Jul 23
I made another version (even smaller, with less graphics and less musics) and had my colleague test it on her phone. Please find the APK attached to this comment, as well as the exported web sources to the project in the zip file. The APK still provides her with a blank screen right at the loading layout. I also made her go to the hosted web project through her Chrome browser. (I have hosted it at https://kyatric.com/work/ampelograf/bugtest/2018.07.23/www/index.html ; it is the exact content of the provided zip file). On the first loading, she sees the logo on the black background (loading of the loader layout images) and then the loading layout with the background images displaying and everything loading as intended. The pink hand appeared, and when she clicked it, it took her to the title screen that displayed only the white background (similar failing issue as observed so far). She then loaded it up again, and on her second try, everything displayed as intended on the screen title. This leads me to believe in some possible kind of failure of the browser cache on the first loading. This possibly is the issue in the APK where it never reaches the images in cache ? The failing behavior is consistent on the APK though. I hope this helps sorting things out.
,
Jul 27
We shipped an update to Construct 3 that disables WebGL 2 on Android and we've had several reports that this fixed a range of graphical issues on Android devices. I am sure there is some kind of issue with either Chrome/webview/GPU drivers. It looks like it's tough to reduce this to a minimal case though.
,
Aug 3
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
,
Aug 3
,
Aug 21
I've tested both ampelograf.android.debug.testbug.apk and 1.0.0.34_reprobug.zip on a Samsung Galaxy S7-2 (SM-G930F) with Mali-T880 running NRD90M.G930FXXU1DQL7. The APK version of the app, as reported, fails to load successfully; the loading screen is pure white and, after tapping, the resulting screen is blue. Occasionally the error reported in the submission: [.Offscreen-For-WebGL-0x9a716000]GL ERROR :GL_INVALID_OPERATION : glTexImage2D: <- error from previous GL command is displayed. Occasionally an error is reported in glGenerateMipmaps. These errors aren't displayed every time the app fails to load correctly, though. The APK does load correctly and reliably on a Pixel 2. Similar behavior can be provoked most of the time by serving up the files from 1.0.0.34_reprobug.zip (on port 8080, in this example), clearing Chrome's data on the phone, and navigating to http://localhost:8080 . I instrumented c2runtime.js to add gl.getError calls before and after the calls to generateMipmap and all of the calls to texImage2D (see attached). When the page fails to load, no OpenGL errors are reported. The page loads correctly on the second try -- once the browser's cache is populated with the app's image resources. I think there is a bug in the Construct engine where it doesn't wait for the onload callback to be called for images which it loads. I set breakpoints on all of the texImage2D calls in c2runtime.js, and the images which were being uploaded didn't have any onload attribute specified. Is it using another synchronization mechanism to ensure that all of its resources are loaded before attempting to upload them to WebGL textures? Marking this as ExternalDependency until this question is answered.
,
Aug 21
Our engine waits for img.complete to be true for all images before proceeding to load the rest of the game (creating textures etc). We have used this approach since our engine was released in 2011 and it's never been a problem before. We recently disabled WebGL 2 on Android in our engine due to the number if reports we had of things not working specifically with WebGL 2, and still working with WebGL 1. Once we did this everyone said the issues on Android were now fixed, so we assumed there is some GPU driver bug or Chromium issue involved. Ideally we'd like to be able to enable WebGL 2 on Android again but it's been difficult to track down exactly what's going on when it doesn't work.
,
Aug 21
Thanks for this information. In order to make progress on this bug I still need some way to reduce this test case. Either the Construct 2 project is needed (you can share this with just me via email), or some way to start trimming down the work which the exported project does. Ideally a smaller Construct 2 project than this one would be provided as a starting point.
,
Aug 21
Project sent through email.
,
Aug 22
Thanks, project received. I would need to be able to edit the project in order to cut it down; it doesn't load fully in the free version of the editor as it stands. My account on editor.construct.net is kbr at google.com.
,
Sep 7
C2 / C3 user here. Just wanted to say that the problem arises on a Huawei Mate 10 phone. Thanks!
,
Sep 11
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by a...@scirra.com
, Jul 20