WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
245476
REGRESSION (iOS 16): WebGL 2 crashing on glReadPixels
https://bugs.webkit.org/show_bug.cgi?id=245476
Summary
REGRESSION (iOS 16): WebGL 2 crashing on glReadPixels
George
Reported
2022-09-21 06:49:44 PDT
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
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-09-21 19:35:50 PDT
<
rdar://problem/100252324
>
George
Comment 2
2022-09-21 21:55:05 PDT
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);
Kimmo Kinnunen
Comment 3
2022-12-01 17:29:01 PST
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.
George
Comment 4
2022-12-06 01:12:16 PST
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!
Kimmo Kinnunen
Comment 5
2022-12-15 08:10:01 PST
Pull request:
https://github.com/WebKit/WebKit/pull/7688
Kimmo Kinnunen
Comment 6
2022-12-19 04:05:53 PST
Pull request:
https://github.com/WebKit/WebKit/pull/7842
EWS
Comment 7
2022-12-19 23:59:27 PST
Committed
258127@main
(5192197861cf): <
https://commits.webkit.org/258127@main
> Reviewed commits have been landed. Closing PR #7842 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug