Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d0eee3fe1ac2b18fe25511062c4462c11a37ce56
      
https://github.com/WebKit/WebKit/commit/d0eee3fe1ac2b18fe25511062c4462c11a37ce56
  Author: Mike Wyrzykowski <[email protected]>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    A LayoutTests/fast/webgpu/copy-external-image-video-frame-expected.txt
    A LayoutTests/fast/webgpu/copy-external-image-video-frame.html
    M 
LayoutTests/http/tests/webgpu/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture-expected.txt
    M 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageBitmap-expected.txt
    M 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageData-expected.txt
    M 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/canvas-expected.txt
    M 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/image-expected.txt
    M 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/video-expected.txt
    M Source/WebCore/Modules/WebGPU/GPUImageCopyExternalImage.h
    M Source/WebCore/Modules/WebGPU/GPUQueue.cpp
    M Source/WebCore/Modules/WebGPU/Implementation/WebGPUQueueImpl.cpp
    M Source/WebCore/Modules/WebGPU/Implementation/WebGPUQueueImpl.h
    M Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUImageCopyExternalImage.h
    M Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/Queue.h
    M Source/WebGPU/WebGPU/Queue.mm
    M Source/WebGPU/WebGPU/WebGPUExt.h
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.cpp
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.h
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.cpp
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.h
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.messages.in
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Scripts/webkit/opaque_ipc_types.tracking.in
    M Source/WebKit/Shared/WebGPU/WebGPUConvertFromBackingContext.h
    M Source/WebKit/Shared/WebGPU/WebGPUConvertToBackingContext.h
    M Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.cpp
    M Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h
    M Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.serialization.in
    M Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.h

  Log Message:
  -----------
  [WebGPU] Very poor texture upload performance when passing canvas
https://bugs.webkit.org/show_bug.cgi?id=294602
rdar://153642354

Reviewed by Tadeu Zagallo.

Optimize HTML element -> GPUTexture copy path when the source
data is already in the GPU process.

Test: fast/webgpu/copy-external-image-video-frame.html
* LayoutTests/fast/webgpu/copy-external-image-video-frame-expected.txt:
* LayoutTests/fast/webgpu/copy-external-image-video-frame.html:
* 
LayoutTests/http/tests/webgpu/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture-expected.txt:
* 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageBitmap-expected.txt:
* 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageData-expected.txt:
* 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/canvas-expected.txt:
* 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/image-expected.txt:
* 
LayoutTests/http/tests/webgpu/webgpu/web_platform/copyToTexture/video-expected.txt:
New passing expectations

* LayoutTests/fast/webgpu/copy-external-image-video-frame-expected.txt: Added.
* LayoutTests/fast/webgpu/copy-external-image-video-frame.html: Added.
* Source/WebCore/Modules/WebGPU/GPUImageCopyExternalImage.h:
(WebCore::GPUImageCopyExternalImage::convertToBacking const):
* Source/WebCore/Modules/WebGPU/GPUQueue.cpp:
(WebCore::isSupportedGPUSourcePixelFormat):
(WebCore::GPUResidentSource::isGPUResident const):
(WebCore::gpuResidentSourceForVideo):
(WebCore::gpuResidentSourceForImageData):
(WebCore::gpuResidentSourceForImageElement):
(WebCore::imageBufferForSource):
(WebCore::GPUQueue::copyExternalImageToTexture):
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUQueueImpl.cpp:
(WebCore::WebGPU::convertToColorSpace):
(WebCore::WebGPU::convertToVideoFrameRotation):
(WebCore::WebGPU::sourceTextureFormat):
(WebCore::WebGPU::QueueImpl::copyExternalImageToTexture):
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUImageCopyExternalImage.h:
* Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm:
(WebCore::transformToRotationProperties):
* Source/WebGPU/WebGPU/BindGroup.mm:
(WebGPU::colorSpaceConversionMatrixForPixelBuffer):
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
* Source/WebGPU/WebGPU/WebGPUExt.h:
* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.cpp:
(WebKit::RemoteGPU::imageBuffer):
* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.h:
* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.cpp:
(WebKit::RemoteQueue::copyExternalImageToTexture):
(WebKit::RemoteQueue::setSharedVideoFrameSemaphore):
(WebKit::RemoteQueue::setSharedVideoFrameMemory):
(WebKit::RemoteQueue::copyExternalImageFromVideoFrameToTexture):
* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.h:
* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.messages.in:
* Source/WebKit/Scripts/webkit/messages.py:
(types_that_must_be_moved):
(headers_for_type):
* Source/WebKit/Scripts/webkit/opaque_ipc_types.tracking.in:
* Source/WebKit/Shared/WebGPU/WebGPUConvertFromBackingContext.h:
* Source/WebKit/Shared/WebGPU/WebGPUConvertToBackingContext.h:
* Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.cpp:
(WebKit::WebGPU::ConvertToBackingContext::convertToBacking):
(WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking):
(WebKit::WebGPU::ConvertToBackingContext::convertToBackingVideoSource):
* Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h:
* Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.cpp:
(WebKit::WebGPU::RemoteQueueProxy::copyExternalImageToTexture):
(WebKit::WebGPU::RemoteQueueProxy::copyExternalImageFromVideoFrameToTexture):
* Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.h:

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



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

Reply via email to