WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
178348
WebGL clear not actually clearing
https://bugs.webkit.org/show_bug.cgi?id=178348
Summary
WebGL clear not actually clearing
Ashley Gullen
Reported
2017-10-16 10:42:59 PDT
We have a WebGL-powered HTML5 game engine. We've started noticing in some cases our calls to gl.clear() are not working. I've tested a MacBook Pro mid-2015 (with Intel Iris Pro graphics). In Chrome and Firefox on the same device, as well as Edge 16 on a Windows 10 PC, it works fine. It's only Safari that seems to have a problem. Test URL:
https://www.scirra.com/labs/bugs/safariclear/
Expected result (using Chrome):
https://www.scirra.com/labs/bugs/safariclear/expected.png
Observed result (in Safari 11):
https://www.scirra.com/labs/bugs/safariclear/observed.png
Safari TP 41 also reproduces the problem. Our engine uses gl.clearColor(1, 1, 1, 1) followed by gl.clear(gl.COLOR_BUFFER_BIT) to clear the background opaque white. In all other browsers this makes the background white as expected. In Safari though it appears to have no effect, leaving the background black. The background does not appear to be written to at all. The previous framebuffer contents is left behind, so as the blue box moves, it leaves behind a trail. Strangely any drawing done with an alpha channel does appear to correctly blend with the white background - the demo uses a blue texture with 1px of transparency around the edges, and that renders as white. I suspect there's a driver bug here, but we can't figure out how to work around it. Preferably Safari would internally work around it, but it would be useful to know what we could do about it too.
Attachments
Add attachment
proposed patch, testcase, etc.
Ashley Gullen
Comment 1
2017-10-16 10:44:57 PDT
Also this does not appear to reproduce in Safari on iOS 11 on an iPad Air 2. It only happens on the MacBook.
Radar WebKit Bug Importer
Comment 2
2017-10-31 00:30:17 PDT
<
rdar://problem/35267358
>
Dean Jackson
Comment 3
2017-11-28 13:13:48 PST
Ashley, does this consistently happen on such a device? If it were a driver bug, then I'd expect the other browsers to have the same behaviour. What operating system are you using?
Dean Jackson
Comment 4
2017-11-28 13:15:42 PST
I tried on a few pieces of hardware and was unable to reproduce. I think I have a 2015 macbook pro. I'll boot it up to try.
Ashley Gullen
Comment 5
2017-11-28 13:45:19 PST
I tested on High Sierra. Perhaps there's a Safari bug then, but it could also be a driver bug specific to Safari's method of compositing.
Dean Jackson
Comment 6
2017-11-28 15:13:27 PST
I tried on the exact hardware and couldn't reproduce. But then I remembered this issue:
https://github.com/mrdoob/three.js/issues/12598
So, it definitely happened. And it sounds like it is now resolved.
Ashley Gullen
Comment 7
2017-12-07 07:33:27 PST
I can verify this is fixed on macOS 10.13.2 in both Safari 11 and TP 45.
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