RESOLVED FIXED 66884
Speed up texImage from BGRA
https://bugs.webkit.org/show_bug.cgi?id=66884
Summary Speed up texImage from BGRA
John Bauman
Reported 2011-08-24 13:14:53 PDT
Speed up texImage from BGRA
Attachments
Patch (3.83 KB, patch)
2011-08-24 13:21 PDT, John Bauman
no flags
Patch (3.83 KB, patch)
2011-08-24 13:39 PDT, John Bauman
no flags
Patch (5.30 KB, patch)
2011-08-25 09:41 PDT, John Bauman
no flags
Patch (5.91 KB, patch)
2011-08-25 10:19 PDT, John Bauman
no flags
fix big endian (6.09 KB, patch)
2011-08-29 12:27 PDT, John Bauman
no flags
John Bauman
Comment 1 2011-08-24 13:21:22 PDT
WebKit Review Bot
Comment 2 2011-08-24 13:28:42 PDT
Comment on attachment 105056 [details] Patch Attachment 105056 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9488247
John Bauman
Comment 3 2011-08-24 13:39:57 PDT
Nat Duca
Comment 4 2011-08-24 18:00:06 PDT
Comment on attachment 105059 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105059&action=review Wheee! What kind of speed gains does this get (not fps, but for the actual pack fn)? > Source/WebCore/platform/graphics/GraphicsContext3D.cpp:1152 > + if (reinterpret_cast<void*>(rowPackingFunc) == reinterpret_cast<void*>(packOneRowOfRGBA8ToRGBA8)) { As a bystander to this code, it took me a while to figure out what this check was really doing --- might want to preceed this with a comment saying "skip unpacking step if does nothing and unpack directly to the destination"?
John Bauman
Comment 5 2011-08-24 19:43:38 PDT
(In reply to comment #4) > (From update of attachment 105059 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=105059&action=review > > Wheee! What kind of speed gains does this get (not fps, but for the actual pack fn)? I'm not sure, as the benchmark I was using increased the amount of work that it had this do when I made it faster, but it maybe takes 1/2 to 1/3 of its old time. I know the benchmark scored about 1.5x what it was without the patch. > > > Source/WebCore/platform/graphics/GraphicsContext3D.cpp:1152 > > + if (reinterpret_cast<void*>(rowPackingFunc) == reinterpret_cast<void*>(packOneRowOfRGBA8ToRGBA8)) { > > As a bystander to this code, it took me a while to figure out what this check was really doing --- might want to preceed this with a comment saying "skip unpacking step if does nothing and unpack directly to the destination"? Good idea.
John Bauman
Comment 6 2011-08-25 09:41:13 PDT
WebKit Review Bot
Comment 7 2011-08-25 10:04:50 PDT
Comment on attachment 105201 [details] Patch Attachment 105201 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9495512 New failing tests: fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html
John Bauman
Comment 8 2011-08-25 10:19:08 PDT
Kenneth Russell
Comment 9 2011-08-25 11:47:10 PDT
Comment on attachment 105207 [details] Patch Looks good to me. Did you run the texture-related WebGL conformance tests and layout tests to ensure no accidental regressions?
John Bauman
Comment 10 2011-08-29 11:58:16 PDT
Yeah, they all seem to work.
Kenneth Russell
Comment 11 2011-08-29 12:06:04 PDT
Comment on attachment 105207 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105207&action=review > Source/WebCore/platform/graphics/GraphicsContext3D.cpp:481 > + uint32_t rgba = (((bgra >> 16) | (bgra << 16)) & 0x00ff00ff) | (bgra & 0xff00ff00); Sorry, I just realized that this won't work correctly on big-endian hardware. You can use #if CPU(BIG_ENDIAN) to gate the code (see html/canvas/DataView.cpp); could you please add another arm?
John Bauman
Comment 12 2011-08-29 12:27:13 PDT
Created attachment 105510 [details] fix big endian
Kenneth Russell
Comment 13 2011-08-29 14:52:14 PDT
Comment on attachment 105510 [details] fix big endian Great, thanks. r=me
WebKit Review Bot
Comment 14 2011-08-29 15:54:19 PDT
Comment on attachment 105510 [details] fix big endian Clearing flags on attachment: 105510 Committed r94026: <http://trac.webkit.org/changeset/94026>
WebKit Review Bot
Comment 15 2011-08-29 15:54:24 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.