WebGL Texture writing performance suddenly degraded
Categories
(Core :: Graphics: CanvasWebGL, defect, P3)
Tracking
()
People
(Reporter: asimental, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Steps to reproduce:
Open following link in Firefox and Chrome: https://playcanv.as/b/fZLdHIEt/
Profile: https://share.firefox.dev/2R7c2vy
Actual results:
Previous smooth performance using Video textures in Playcanvas suddenly degraded causing framerates to drop from 60 to 17fps. Framerate remains smooth 60fps in Chrome with same video.
Spec of testing Computer:
OS: Windows 10 Pro
CPU: AMD Ryzen 9 3900X
GPU: Nvidia RTX 2070 SUPER
RAM: 32GB
VRAM: 8GB
Resolution at Fullscreen: 1920x1080
Expected results:
Same performance in writing textures as Chrome
Texture writing was previously stable on Version 85.0.2 (64-bit)
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Canvas: WebGL' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Related to: https://bugzilla.mozilla.org/show_bug.cgi?id=1709077
Changing texture writing to RGBA instead of RGB restore performance
Related to: https://bugzilla.mozilla.org/show_bug.cgi?id=1708491 Changing writing to RGBA instead of RGB fixed performance issue
Comment 5•3 years ago
|
||
Has there been any work on this? This is a major issue for productions sites that use WebGL video (of which there are many). I just filed what is probably a duplicate bug - https://bugzilla.mozilla.org/show_bug.cgi?id=1736923
Here is a pure WebGL replication with a 4k 60fps video - https://jsfiddle.net/Lmy0b3xt
This plays back in latest Chrome at 60fps, and ~5fps in Firefox 93
Comment 6•3 years ago
|
||
Also, I don't believe this latest regression is specific to RGB vs RGBA. The replication in my previous post is with RGB.
No progress from what I have seen. Changing line 124 of your fiddle to:
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA,
appeared to restore performance in Firefox 93. Looks like there's still some artificial CPU limitation on RGB, but not RGBA
Comment 8•3 years ago
|
||
Yah, sorry you are right. I misread your post. Same issue.
I posted a summary post here - https://github.com/MozillaReality/FirefoxReality/issues/3973 - Hope someone can take a look.
Updated•3 years ago
|
Comment 10•3 years ago
|
||
It's probably possible to handle that, though RGB uploads are generally much slower than RGBA uploads (because RGB resources are actually RGB1/RGBX formats, and OpenGL's packed RGB/UNSIGNED_BYTE uploads are known-slow)
RGB8 is always color-renderable in ES3 though, so it might be safe.
Comment 11•3 years ago
|
||
I have implemented the RGBA workaround for our production site, but I imagine there are many other production WebGL-based sites that use RGB textures and are unaware of this performance regression in Firefox (as RGB works fine in other browsers). Do you think this would be worth prioritizing for the next release?
Reporter | ||
Comment 12•3 years ago
|
||
(In reply to Jeff Gilbert [:jgilbert] from comment #10)
It's probably possible to handle that, though RGB uploads are generally much slower than RGBA uploads (because RGB resources are actually RGB1/RGBX formats, and OpenGL's packed RGB/UNSIGNED_BYTE uploads are known-slow)
RGB8 is always color-renderable in ES3 though, so it might be safe.
I could see why that might be slowing things down, but what made the way Version 85.0.2 (64-bit) processed RGB textures from the way it is now? It wasn't until after that version that things slowed down tremendously.
Comment 13•3 years ago
|
||
In case it might help for testing, I think this site might also be affected, as all I seem to see in a quick perf profile is time spent in uploadTexture for a WebGL context from a video element: https://www.rimac-automobili.com
Updated•3 years ago
|
Comment 14•7 months ago
|
||
(In reply to asimental from comment #3)
Related to: https://bugzilla.mozilla.org/show_bug.cgi?id=1709077
Changing texture writing to RGBA instead of RGB restore performance
Fixed by bug 1883225.
Description
•