-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRGB8_ALPHA8 blocks the main thread #22631
Comments
Um, it seems there is not much we can do on engine level to avoid this overhead. Even when using This is probably something we should report to the Chromium team. I've not found an existing issue for this topic https://bugs.chromium.org/p/chromium/issues/list |
It seems the overhead is way smaller on macOS. I've tested both live examples with Chrome/FF and barely see a difference. Can somebody else verify this with a Mac? |
Yeah, looks like there's no way around this since the API is synchronous (
I can do that later unless someone else beats me to it. |
My main development machine is a Mac and there's no visible stall while loading the sRGB example above on Chrome 96.0.4658.0 (Official Build) canary (x86_64). On what platform is this reproduced? Can you provide the contents of Chrome's |
Also, can you provide a zip archive containing all of the sources for this example, unminified, so we can easily edit them? |
I can't reproduce this on my (macOS) machine either, but would be curious whether |
I'm experiencing the stall on a Windows 10 system with an NVIDIA GTX 1050 Ti. Here's my about-gpu.txt The freeze occurs in This could be an ANGLE thing. Should I still open a new issue in the Chromium bug tracker?
Sure! srgb-blocking-example.zip (Needs to be served locally with |
Yes, please file on https://crbug.com/ . The problem might be on the Chromium or ANGLE side, so filing under Chromium is more general. Please include |
Bug ID → 1256340 |
Closing. Let's continue the discussion at the Chromium bug tracker. |
For me it seems also to be a problem with latest Firefox 93.0 |
@LinoPhil Would you be willing to report this issue to Mozilla: https://bugzilla.mozilla.org/ |
I can throw my fiddle examples on them, but i dont know if my expertise is enough to correctly explain it to them. Dont know if a bad bug report speeds things up :/ |
Should we revert #22551 until this bug is resolved? Especially if more than one browser is doing things this way. |
Um, is it realistic that https://bugs.chromium.org/p/chromium/issues/detail?id=1256340 is fixed soon?
If we decide to revert, I would not revert the entire PR but only comment out specific lines in |
@Mugen87 Yeah, that sounds reasonable. I have no idea when that Chrome bug might get fixed, but even if it was tomorrow, we'd be dealing with this for months. If it's actually a problem in Firefox too, then it's even stickier. |
I've filed a PR so it's easier to see the necessary changes: #22759 |
As I've mentioned on https://bugs.chromium.org/p/chromium/issues/detail?id=1256340 this appears to be an issue with how ANGLE generates mipmaps for sRGB textures. An effective workaround for this bug (while an ANGLE fix is pending) would be to either: A) Not use gl.generateMipmaps() with sRGB textures For those with an affected system, you can see the issue with this (non-Three.js) test page: https://toji.github.io/web-texture-tool/demo/srgb-test.html Generally I see that it runs fine with the exception of when I select sRGB textures, have it generate mipmaps, and turn off |
Describe the bug
The introduction of
SRGB8_ALPHA8
in #22551 improved the render quality of sRGB textures, but also added significant synchronous conversion times that block the main thread. Every sRGB texture adds to the total blocking time, resulting in a poor user experience, especially when the scene contains many textures.To Reproduce
Steps to reproduce the behavior:
encoding
of any Uint8 RGBA texture tosRGBEncoding
. (WebGL 2 context is required.)Code
The following example loads a cube map and sets its encoding to
sRGBEncoding
:https://codesandbox.io/s/srgb8-alpha8-wv3jf?runonclick=1&file=/index.js
Live example
The blocking behaviour can also be observed in live examples that load GLTF models, such as https://threejs.org/examples/?q=gltf#webgl_loader_gltf.
Expected behavior
Ideally, the main thread should not be blocked at all. Blocking time should at least be reduced as much as possible.
Screenshots
LinearEncoding
orsRGBEncoding
pre r133sRGBEncoding
since r133Platform:
The text was updated successfully, but these errors were encountered: