[webkit-changes] [WebKit/WebKit] cf9b85: [WebGPU] copyExternalImageToTexture incorrectly co...

mwyrzykowski noreply at github.com
Mon Jun 3 17:05:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cf9b85a711b46cec55a1244d3aac0327be9828a1
      https://github.com/WebKit/WebKit/commit/cf9b85a711b46cec55a1244d3aac0327be9828a1
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M Source/WebCore/Modules/WebGPU/GPUQueue.cpp

  Log Message:
  -----------
  [WebGPU] copyExternalImageToTexture incorrectly copies images from HTMLImageElement
https://bugs.webkit.org/show_bug.cgi?id=274789
<radar://128380266>

Reviewed by Dan Glastonbury.

We were assuming the byte order was always RGBA and not handling
ARGB or ABGR, where A can be X or A.

Correct this by manually swapping.

https://bugs.webkit.org/show_bug.cgi?id=263692 tracks moving this to the GPU
process and we could perform the swaps in a fragment shader as the goal is to
populate a MTLTexture.

* Source/WebCore/Modules/WebGPU/GPUQueue.cpp:
(WebCore::getImageBytesFromImageBuffer):
(WebCore::getImageBytesFromVideoFrame):
(WebCore::imageBytesForSource):
(WebCore::populdateXYFromOrigin):
(WebCore::copyToDestinationFormat):
(WebCore::GPUQueue::copyExternalImageToTexture):

Canonical link: https://commits.webkit.org/279680@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list