Closed Bug 1709726 Opened 3 years ago Closed 15 days ago

Failed to upload video element to WebGL texture with texImage2D()

Categories

(Core :: Graphics: CanvasWebGL, defect, P1)

Firefox 90
Unspecified
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 1842735

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

  1. Plug in an Android device to your laptop
  2. Open Firefox remote debugging tool on the laptop
  3. Open the URL in your Android Firefox (Nightly)
  4. Select mp4 or webm and click run button
  5. 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.

Component: Untriaged → Canvas: WebGL
OS: Unspecified → Android
Product: Firefox → Core
Summary: texImage2D video → Failed to upload video element to WebGL texture with texImage2D()
Regressed by: 1640607
Has Regression Range: --- → yes

When the problem happened, ClientWebGLContext::TexImage() was called and failed to upload data at the following.

Fast path needs to be supported for SurfaceTextureImage in ClientWebGLContext::TexImage().

ogv files play without problem only mp4 files are causing the problem

https://github.com/mrdoob/three.js/issues/22406

See Also: → 1709661
Depends on: 1736793

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

(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.

Severity: -- → S3
Priority: -- → P1
Status: UNCONFIRMED → RESOLVED
Closed: 15 days ago
Duplicate of bug: 1842735
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.