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

mwyrzykowski noreply at github.com
Tue Jun 4 14:21:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ba118a8e2812438fef7ee0535f3e70d9dea5047a
      https://github.com/WebKit/WebKit/commit/ba118a8e2812438fef7ee0535f3e70d9dea5047a
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2024-06-04 (Tue, 04 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.

Re-land with release assert in correct location.

* 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/279714@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