Bug 44459

Summary: fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html failing on Snow Leopard bot
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Adrienne Walker <enne>
Status: RESOLVED WONTFIX    
Severity: Normal CC: abarth, cmarrin, dglazkov, enne, eric.carlson, eric, zmo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Comment 1 Kenneth Russell 2010-08-23 15:37:43 PDT
Note: this is failing at least with WebKit (run-webkit-tests --debug LayoutTests/fast/canvas/webgl).
Comment 2 Kenneth Russell 2010-08-24 17:24:24 PDT
Committed r65955: <http://trac.webkit.org/changeset/65955>
Comment 3 Kenneth Russell 2010-08-24 17:26:00 PDT
Oops, I unintentionally closed this bug with webkit-patch land. Checked in a disabling of this test on the bots to get them green again. See LayoutTests/platform/mac-snowleopard/Skipped and the above commit, which will need to be reverted when submitting the official fix.
Comment 4 Eric Seidel (no email) 2010-08-24 17:27:25 PDT
many webkit-patch commands respect --no-close which you may find useful in the future.  see webkit-patch help land for more information.
Comment 5 Adrienne Walker 2010-09-07 17:00:25 PDT
This original bug appears to be due to a poorly generated mp4 file.  The theora video has the right colors, but the mp4 has slightly incorrect colors.

After discussion with gman, I decided to just convert the existing test from the Khronos conformance test which uses a red-green video like all of the other tex-image tests for consistency.

Unfortunately, that test failed in both Chromium and Safari on 10.6.

After some investigation, this bug appears to be due to something in Cg, rather than something video-related.  The video appears fine in a <video> tag.  The <video> draws correctly into a 2D canvas.  However, using the <video> or the <canvas> (with the video drawn into it) as an input to texImage2D in WebGL results in black pixels.

Oddly, this only occurs with the red-green video and not with the original video from this bug.

No solution yet, but I just wanted to leave a comment about its progress.
Comment 6 Adrienne Walker 2010-09-27 16:11:54 PDT
Here's the link to the test case that will get checked in once it's working: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/tex-image-and-sub-image-2d-with-video.html

After some discussion with dhyatt on irc, he suggested looking at the ImageBufferCG data after the call to HTMLVideoElement::paintCurrentFrameIntoContext.  This turned out to all be [0,0,0,255], which leads me back to believe that maybe there is something wrong on the video end.

However, I still don't understand why painting the current frame of a video into an ImageBuffer works in one case (2D canvas) but doesn't in this case (WebGL canvas).

CCing Eric Carlson on this bug, who might have some thoughts about why this is occurring.
Comment 7 Adrienne Walker 2011-01-11 15:36:09 PST
Created attachment 78611 [details]
Patch
Comment 8 Adrienne Walker 2011-01-11 15:37:54 PST
(In reply to comment #7)
> Created an attachment (id=78611) [details]
> Patch

Whatever bug was causing this to fail on OSX with the video that was checked into Khronos appears to have been fixed.
Comment 9 Kenneth Russell 2011-01-11 15:45:19 PST
Comment on attachment 78611 [details]
Patch

Looks OK. Please watch the bots after committing this in case something unexpected happens.
Comment 10 Zhenyao Mo 2011-01-11 15:46:15 PST
Is webm also supported in Safari?
Comment 11 Adrienne Walker 2011-01-11 16:39:32 PST
Committed r75570: <http://trac.webkit.org/changeset/75570>
Comment 13 Adrienne Walker 2011-01-12 13:35:44 PST
(In reply to comment #12)
> Reopened again, argh.
> 
> Reverted expectations here: http://trac.webkit.org/changeset/75579
> 
> Layout test errors here: http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r75570%20(23470)/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-pretty-diff.html

This is awfully curious.  If I run the exact command line from http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20(Tests)/builds/23470/steps/layout-test/logs/stdio on my Intel Snow Leopard box, this test reliably passes.
Comment 14 Kenneth Russell 2011-01-12 13:39:19 PST
(In reply to comment #13)
> (In reply to comment #12)
> > Reopened again, argh.
> > 
> > Reverted expectations here: http://trac.webkit.org/changeset/75579
> > 
> > Layout test errors here: http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r75570%20(23470)/fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-pretty-diff.html
> 
> This is awfully curious.  If I run the exact command line from http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20(Tests)/builds/23470/steps/layout-test/logs/stdio on my Intel Snow Leopard box, this test reliably passes.

Could it have something to do with whether the machine has a monitor attached? What happens if you reboot your Snow Leopard machine with no monitor attached, ssh in and run the test?
Comment 15 Adrienne Walker 2011-01-12 13:52:02 PST
(In reply to comment #14)

> Could it have something to do with whether the machine has a monitor attached? What happens if you reboot your Snow Leopard machine with no monitor attached, ssh in and run the test?

All the webgl Layout tests crash if I do that.

I guess I don't follow how not having a monitor attached would affect this test.   Isn't DumpRenderTree pushing everything through Mesa?
Comment 16 Zhenyao Mo 2011-01-12 14:03:58 PST
(In reply to comment #15)
> (In reply to comment #14)
> 
> > Could it have something to do with whether the machine has a monitor attached? What happens if you reboot your Snow Leopard machine with no monitor attached, ssh in and run the test?
> 
> All the webgl Layout tests crash if I do that.
> 
> I guess I don't follow how not having a monitor attached would affect this test.   Isn't DumpRenderTree pushing everything through Mesa?

only --chromium will run top of mesa.
Comment 17 Eric Seidel (no email) 2011-01-12 14:07:42 PST
(In reply to comment #15)
> (In reply to comment #14)
> 
> > Could it have something to do with whether the machine has a monitor attached? What happens if you reboot your Snow Leopard machine with no monitor attached, ssh in and run the test?
> 
> All the webgl Layout tests crash if I do that.
> 
> I guess I don't follow how not having a monitor attached would affect this test.   Isn't DumpRenderTree pushing everything through Mesa?

All layout tests will crash when run via SSH. :)  They require an active UI session.  so you have to use VNC.  It may be possible these days to first VNC to the box and then connect via SSH and run them from within the SSH connection while VNC'd.