Closed Bug 1336289 Opened 7 years ago Closed 7 years ago

ConvertPlanarYCbCr and ConvertMacIOSurfaceImage shaders fail to compile

Categories

(Core :: Graphics, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox54 --- affected

People

(Reporter: kvark, Assigned: jgilbert)

References

()

Details

(Whiteboard: gfx-noted)

Attachments

(1 file)

Original bug - https://bugzilla.mozilla.org/show_bug.cgi?id=1330672
Also possibly related: https://bugzilla.mozilla.org/show_bug.cgi?id=891204, https://bugzilla.mozilla.org/show_bug.cgi?id=1191527

The YUV shader decoding path seems to only happening on Linux.
Both Windows and OSX machines fail to compile the shaders and fall back to software, while still attempting to compile them every frame.

Both cases spew the console log:
"texSubImage2D: Failed to hit GPU-copy fast-path. Falling back to CPU upload." 

 --- OSX case ---
Mac Mini 2010, OSX 10.12, NVidia GeForce 320M

Error (see firefox-osx.trace provided):
"0:2(12): error: extension `GL_ARB_texture_rectangle' unsupported in fragment shader"

Changing the version requirement to 120 gets it going, but produces incorrect image. Preliminary investigation showed that we are not binding the `uCbCrTexture` correctly according to YCBCR_422_APPLE extension. We expect the surface to have 2 planes, but it seems to have a single plane with 2 channels instead.

 --- Windows case ---
Windows 7, Radeon RX 480

Compositing with Direct3D 11, using Angle.
A RenderDoc capture doesn't show any failed shader loading since they are caught by Angle and not reaching D3D11.
(don't have any more info, let me know if needed)
Attached file firefox-win.rdc
RenderDoc capture of non-e10s YCbCR video playback on Windows
Who was working on YCbCr last, Milan?
Flags: needinfo?(milan)
Priority: -- → P1
Whiteboard: gfx-noted
OS: Windows 7 → All
Hardware: x86_64 → All
(In reply to Dzmitry Malyshau [:kvark] from comment #0)
> ...
> 
> Changing the version requirement to 120 gets it going, but produces
> incorrect image. Preliminary investigation showed that we are not binding
> the `uCbCrTexture` correctly according to YCBCR_422_APPLE extension. We
> expect the surface to have 2 planes, but it seems to have a single plane
> with 2 channels instead.

This would explain Mac, sounds like we need more investigation for Windows.


(In reply to Jeff Gilbert [:jgilbert] from comment #2)
> Who was working on YCbCr last, Milan?

I'm not convinced this is a recent regression.  Sotaro has done some recent work, but I'm not sure it's related.  Sotaro, can you take a quick look?

Dzmitry - is there a minimal case that reproduces failed shader compilation?

Jeff - can we have a patch with MOZ_ASSERT when compilation fails, at least for the local testing?
Flags: needinfo?(sotaro.ikeda.g)
Flags: needinfo?(milan)
Flags: needinfo?(kvark)
Flags: needinfo?(jgilbert)
> This would explain Mac, sounds like we need more investigation for Windows.

Yes, I haven't set up the build environment on the Windows machine at home, so I didn't test the fix (of bumping the GLSL version).

> Dzmitry - is there a minimal case that reproduces failed shader compilation?

I haven't tried to move the shader code out and compile it independently of Firefox. The test case I used was launching FF and following the link (that decodes YCbCr video).
Flags: needinfo?(kvark)
APPLE_ycbcr_422 definitely looks like it's single-plane interleaved:
[Y0,Cb0], [Y1,Cr1], [Y2,Cb2], [Y3,Cr3]

It's also an RGB format, so we should be sampling as .rgb, not doing conversion ourselves.

I will gladly add asserts.
Uh, wow, this code is a mess.
Flags: needinfo?(jgilbert)
I'll take this for now.
Assignee: nobody → jgilbert
(In reply to Milan Sreckovic [:milan] from comment #3)
> I'm not convinced this is a recent regression.  Sotaro has done some recent
> work, but I'm not sure it's related.  Sotaro, can you take a quick look?

I just changed a color matrix coefficient. It should not be related to this bug.

Mac IOSurface problem seems to related to Bug 1248323. It changed color format from NV12 to YUV422. When IOSurface support was added to GLBlitHelper by Bug 1191534, it uses NV12 as color format.
Flags: needinfo?(sotaro.ikeda.g)
This is an assigned P1 bug without activity in two weeks. 

If you intend to continue working on this bug for the current release/iteration/sprint, remove the 'stale-bug' keyword.

Otherwise we'll reset the priority of the bug back to '--' on Monday, August 28th.
Keywords: stale-bug
Keywords: stale-bug
Fixed by bug 1322746.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: