Bug 234230 - Safari 15: Flicker when creating and displaying textures in render loop
Summary: Safari 15: Flicker when creating and displaying textures in render loop
Status: RESOLVED DUPLICATE of bug 203148
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 15
Hardware: Mac (Intel) macOS 12
: P2 Normal
Assignee: Kimmo Kinnunen
URL: https://jsbin.com/wuqivikupo/1/edit?h...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-13 01:58 PST by marcus.stenbeck
Modified: 2021-12-14 05:37 PST (History)
3 users (show)

See Also:


Attachments
example code (7.42 KB, text/plain)
2021-12-13 01:58 PST, marcus.stenbeck
no flags Details
video of issue in safari 14 (4.19 MB, video/quicktime)
2021-12-13 11:13 PST, marcus.stenbeck
no flags Details
video of issue in safari 14 mp4 (474.31 KB, video/mp4)
2021-12-13 11:17 PST, marcus.stenbeck
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description marcus.stenbeck 2021-12-13 01:58:19 PST
Created attachment 446979 [details]
example code

When a texture is created and displayed in a render loop using requestAnimationFrame it causes severe flickering between the image and a black frame. 

The end-user solution is of course to prefer creating textures inside the render loop. But this shouldn't be flickering regardless, and other browsers don't have this issue.

https://jsbin.com/wuqivikupo/1/edit?html,output
Comment 1 Alexey Proskuryakov 2021-12-13 09:32:49 PST
Could you please confirm whether this is a new problem in Safari 15, and Safari 14.x worked well? 

Are any live websites affected?
Comment 2 marcus.stenbeck 2021-12-13 11:13:36 PST
Created attachment 447029 [details]
video of issue in safari 14

The issue is present in Safari 14 too. I've uploaded a video showing the issue in Safari 14.

Tested on 

MacBook Pro (Retina, Mid 2012)
macOS Catalina 10.15.7 (19H2)
2,6 GHz Quad-Core Intel Core i7
Comment 3 marcus.stenbeck 2021-12-13 11:17:59 PST
Created attachment 447032 [details]
video of issue in safari 14 mp4
Comment 4 Kenneth Russell 2021-12-13 13:16:06 PST
For what it's worth, this reproduces easily on Safari Technology Preview Release 136 (Safari 15.4, WebKit 16613.1.9.2).

Kimmo, I think this is related to state saving / restoration in the GPU-based texture uploading code. Do you think you could triage it?
Comment 5 Kimmo Kinnunen 2021-12-14 05:37:01 PST
Thanks for the report.
The underlying bug is most likely bug 203148.
To work around the problem, avoid deleting and recreating the texture object itself.
Instead, create the texture object once and use texImage2D to upload to it.

*** This bug has been marked as a duplicate of bug 203148 ***