Closed Bug 1372110 Opened 7 years ago Closed 7 years ago

WebGL and Fast path is broken...

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1373163

People

(Reporter: jya, Unassigned)

References

(Depends on 1 open bug)

Details

Not yet identified if this is a regression, or it just never worked..

But in my work on adding a new type of video image type (a D3D11 image with a YCbCr texture) I noticed that any images not implementing a special case for GLBlitHelper::BlitImageToFramebuffer, the end result always being a black frame (with glcontext.GLError having the value 1282).
This is the case for any HW accelerated image (h264, vp9 on some machines etc)

This is normally called from WebGLContext::FromDomElem which will call GLBlitHelper if present and normally (as it was explained to me at least) is supposed to revert to GetAsSourceSurface as a backup if GLBlitHelper::BlitImageToFramebuffer failed.
https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTextureUpload.cpp?q=WebGLContext%3A%3AFromDomElem&redirect_type=single#321

we never hit that code path however as (in all my tests at least) layersImage is always set.

Another example not working is the MDN webgl sample page, only shows a black screen:
https://mdn.github.io/webgl-examples/tutorial/sample8/

works fine in Chrome.

I'll explore further.
It's when 

example:
[1] https://people-mozilla.org/~jyavenard/webgl-videotest/webgl-videotest.html?content=gizmo.mp4&fast=false
[2] https://people-mozilla.org/~jyavenard/webgl-videotest/webgl-videotest.html?content=gizmo.mp4&fast=true

The difference between and [1] and [2] is that in [2], it does gl.pixelStorei(ext.UNPACK_REQUIRE_FASTPATH, true);

https://dxr.mozilla.org/mozilla-central/source/gfx/gl/GLBlitHelper.cpp?q=BlitImageToFramebuffer&redirect_type=direct#807 only have code to handle YUV420 software image, mac IOSurface image and Android ones.

Every other type will fail, that includes D3D9SurfaceImage, D3D11ShareHandleImage and so on...

There's no fallback to using GetAsSourceSurface.

Why dom/canvas/test/webgl-mochitest/test_video_fastpath_mp4.html works on machine accelerated device is  mystery for now
Summary: WebGL is apparently broken... → WebGL and Fast path is broken...
mozregression gives me:
2017-06-12T21:49:46: DEBUG : Using url: https://hg.mozilla.org/mozilla-central/json-pushes?changeset=e9a5d4f62461ee0db07a41f59b73163ec106bc3e&full=1
2017-06-12T21:49:46: DEBUG : Found commit message:
Bug 1337509 - Do not create tab objects with an unsupported 'selected' property. r=bsilverberg,mixedpuppy

MozReview-Commit-ID: 4Bi6LdNUxMo

Got that twice, working with different regression range.

Though, it makes no sense to me being so different.
Blocks: 1337509
not bug 1337509, can still reproduce with local reversal.
No longer blocks: 1337509
Depends on: 1373163
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.