Hallo, We have just updated to IOS 16 and found a serious issue in WebGL2 glReadPixels function call from our wasm module. glReadPixes either crashes on bigger files or becomes very slow on smaller files. Everything was working nice and fast on IOS 15.5, until we updated to IOS 16.0 (and Safari 16.0 I suppose). To reproduce the crashing issue (on IOS 16.0 only) please do as follows, for reference I have tried on iPhone 12. 1. Open this URL: https://tinyurl.com/mry9mkrj 2. The page will load a mid-size 3D Model 3. Now try to rotate it (this will make a call to glReadPixels to get a pivot) 4. BSOD Crash: WebGL: context lost. readPixels To reproduce the slow glReadPixels function issue (on IOS 16.0 only) please do as follows, for reference I have tried on iPhone 12. 1. Open this URL: https://tinyurl.com/2unkf9kx 2. The page will load a small 3D Model that rotates now fast Now we can start sending many glReadPixels to notice major drop in FPS. To do that follow below steps: 3. Click on Pick Mode and select length 4. Use the thumb widget to measure some distance length and see how slowly it responds to glReadPixels Everything was working fine in IOS 15, looks like a major issue as glReadPixels is a core WebGL2 call. Thanks
<rdar://problem/100252324>
This is also the code inside my wasm module, if it helps... glBindFramebuffer(GL_READ_FRAMEBUFFER, m_GbufferES.fbo); glReadBuffer(m_GbufferES.color_depth_buffer); // SLOW or CRASHING STEP (IOS 16): glReadPixels(x, y, dim.x, dim.y, GL_RGBA_INTEGER, GL_INT, depth_pixel_v); depth_pixel = depth_pixel_v[0]; glBindFramebuffer(GL_FRAMEBUFFER, 0);
Thanks for the report. This seems to be a out-of-memory in our GPU process due to the lack of owner attribution for read pixels memory. While we fix this, you can see if you can reduce the amount of pixels read. I'm observing: - one 1x1 read pixels which likely is not the problem. - one fullscreen read pixels, which likely is the problem.
Hallo and thanks for the reply, I am not sure what lack of owner attribution is but I double tested my code and it looks like all calls are 1x1 and still getting the same issue. We are waiting for the fix! Thanks!
Pull request: https://github.com/WebKit/WebKit/pull/7688
Pull request: https://github.com/WebKit/WebKit/pull/7842
Committed 258127@main (5192197861cf): <https://commits.webkit.org/258127@main> Reviewed commits have been landed. Closing PR #7842 and removing active labels.