WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 222790
WebGL2: Red flickering when using copyTexImage2D()
https://bugs.webkit.org/show_bug.cgi?id=222790
Summary
WebGL2: Red flickering when using copyTexImage2D()
Michael Herzog
Reported
2021-03-05 02:25:17 PST
I've enabled WebGL 2 in Safari Technology Preview Release 121 (Safari 14.2, WebKit 15612.1.4.3) on macOS 10.15.7. Please open
https://threejs.org/examples/#webgl_framebuffer_texture
The demo renders a scene and then copies a portion of the framebuffer into a texture (via copyTexImage2D()). This texture is then used for a sprite which is rendered at the top-left corner of the screen with an additional render pass. When you now hover with the mouse over the links in the left menu bar, the sprite starts to flicker red. This does not happen when using WebGL1 and not with latest Firefox and Chrome. When using stable Safari (Version 14.0 15610.1.28.1.9, 15610) and WebGL 2, there is only a signle red flicker right when loading the page (but not when hovering links). My system: iMac (Retina 5K, 27'', ultimo 2014) 4 GHz Quad-Core Intel Core i7 16 GB 1600 MHz DDR3 AMD Radeon R9 M295X 4 GB
Attachments
Patch
(15.57 KB, patch)
2021-03-08 05:26 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Kenneth Russell
Comment 1
2021-03-05 21:09:15 PST
On my machine (2017 15" MacBook Pro, Intel HD 630 / AMD Radeon 560), the sprite flickers to black while hovering over the links on the left. The texture copying code looks correct - it's doing the copy inside the requestAnimationFrame callback. Otherwise I might have guessed it was relying on undefined behavior, if preserveDrawingBuffer is set to the default false (haven't checked). The behavior is quite strange. I don't know how other rendering work the browser is doing could interfere with the WebGL rendering in this way. Could this have something to do with how the WebGLLayer publishes its textures to the compositor? Kimmo, can you reproduce?
Kimmo Kinnunen
Comment 2
2021-03-08 05:26:08 PST
Created
attachment 422557
[details]
Patch
Kimmo Kinnunen
Comment 3
2021-03-08 05:28:19 PST
Red is the uninitialized IOSurface contents visible due to multisample resolve blit erroring out.
Kenneth Russell
Comment 4
2021-03-08 16:07:17 PST
Comment on
attachment 422557
[details]
Patch Looks good. Would you please consider putting up a pull request enhancing the associated tests in the WebGL conformance suite? Please see
https://github.com/KhronosGroup/WebGL/issues/3255
. Thanks. r+
EWS
Comment 5
2021-03-09 00:53:36 PST
Committed
r274141
: <
https://commits.webkit.org/r274141
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 422557
[details]
.
Radar WebKit Bug Importer
Comment 6
2021-03-09 00:54:15 PST
<
rdar://problem/75207365
>
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