Failed to upload video element to WebGL texture with texImage2D()
Categories
(Core :: Graphics: CanvasWebGL, defect, P1)
Tracking
()
People
(Reporter: hogehoge, Unassigned)
References
(Regression)
Details
(Keywords: regression)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Firefox for Android
Steps to reproduce:
The latest Android Firefox Nightly fails to upload videos to WebGL textures with gl.texImage2D().
The problem has been originally found in Mozilla Hubs
https://github.com/mozilla/hubs/issues/4213
Due to this bug, videos are not rendered in Hubs on Android Firefox. This is a sort of big issue for Hubs. I hope it will be fixed soon.
Steps to reproduce
I made a minimal test which just runs gl.texImage2D() to upload ready to play videos.
https://takahirox.github.io/texImage2D-gl-test/index.html
- Plug in an Android device to your laptop
- Open Firefox remote debugging tool on the laptop
- Open the URL in your Android Firefox (Nightly)
- Select mp4 or webm and click run button
- See the gl.texImage2D() warnings in the remote debugging tool console
Actual results:
Failed to upload videos with the following warnings
WebGL warning: tex(Sub)Image[23]D: Resource has no data (yet?). Uploading zeros.
WebGL warning: drawElementsInstanced: Tex image TEXTURE_2D level 0 is incurring lazy initialization.
An interesting thing is that ogv works fine with no error.
Additional context
Uploading videos to texture works fine with no errors/warnings on desktop Windows Firefox/Chrome and Android Chrome.
Device information
Samsung Galaxy S8+
Android version 9 / Kernel version 4.4.111-21427293
Android Firefox Nightly version 90.0a1
I reported the problem to Fenix GitHub, too.
https://github.com/mozilla-mobile/fenix/issues/19399
Expected results:
WebGL texImage2D() can upload videos to WebGL texture without errors/warnings on Android Firefox.
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 1•4 years ago
•
|
||
When the problem happened, ClientWebGLContext::TexImage() was called and failed to upload data at the following.
- [1] layersImage->GetDesc() returned Nothing(). An it caused Resource has no data (yet?). Uploading zeros..
- [2] Even when SurfaceTextureImage returned valid SurfaceTextureDescriptor, it is not handled in ClientWebGLContext::TexImage(). Since [image->GetAsSourceSurface()] (https://searchfox.org/mozilla-central/rev/5fe255d4f6e7d7c6794d81fabe90d75ece7bb2a4/dom/canvas/ClientWebGLContext.cpp#4032) is not supported by SurfaceTextureImage.
Fast path needs to be supported for SurfaceTextureImage in ClientWebGLContext::TexImage().
Updated•4 years ago
|
ogv files play without problem only mp4 files are causing the problem
Comment 3•4 years ago
|
||
Potentially related to - https://bugzilla.mozilla.org/show_bug.cgi?id=1736923 even though it's not specific to Android.
Try replicating with this pure WebGL video test - https://jsfiddle.net/Lmy0b3xt
Comment 4•4 years ago
|
||
(In reply to dustin.kerstein from comment #3)
Potentially related to - https://bugzilla.mozilla.org/show_bug.cgi?id=1736923 even though it's not specific to Android.
Try replicating with this pure WebGL video test - https://jsfiddle.net/Lmy0b3xt
This seems to related to the following, blit is used only when pi.format is GL_RGBA.
When "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, video);" was changed to "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);", fps was changed to 11fps to 144fps for me on Windows10 PC.
Updated•4 years ago
|
Updated•1 year ago
|
Description
•