Title: [268869] trunk/Source/WebCore
Revision
268869
Author
[email protected]
Date
2020-10-22 09:47:20 -0700 (Thu, 22 Oct 2020)

Log Message

[WebGPU] Add Dawn implementation skeleton
https://bugs.webkit.org/show_bug.cgi?id=217982

Reviewed by Myles C. Maxfield.

Add an empty implementation of the WebGPU types. This gets WebGPU built and linking
using Dawn.

* PlatformWinCairo.cmake:
* platform/Dawn.cmake: Added.
* platform/graphics/gpu/GPUPlatformTypes.h:
* platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUBindGroupAllocator::create):
(WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator):
(WebCore::GPUBindGroupAllocator::reallocate):
(WebCore::GPUBindGroupAllocator::tryReset):
* platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUBindGroup::tryCreate):
(WebCore::GPUBindGroup::GPUBindGroup):
(WebCore::GPUBindGroup::~GPUBindGroup):
* platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUBindGroupLayout::tryCreate):
* platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Added.
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::state const):
(WebCore::GPUBuffer::mapOnCreation):
(WebCore::GPUBuffer::registerMappingCallback):
(WebCore::GPUBuffer::runMappingCallback):
(WebCore::GPUBuffer::stagingBufferForRead):
(WebCore::GPUBuffer::stagingBufferForWrite):
(WebCore::GPUBuffer::copyStagingBufferToGPU):
(WebCore::GPUBuffer::unmap):
(WebCore::GPUBuffer::destroy):
* platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUCommandBuffer::tryCreate):
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
(WebCore::GPUCommandBuffer::copyTextureToTexture):
* platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUComputePassEncoder::tryCreate):
(WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
(WebCore::GPUComputePassEncoder::setPipeline):
(WebCore::GPUComputePassEncoder::dispatch):
(WebCore::GPUComputePassEncoder::platformPassEncoder const):
* platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::recompile):
* platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUDevice::tryCreate):
(WebCore::GPUDevice::GPUDevice):
* platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Added.
(WebCore::HandleDeleter<PlatformBuffer>::operator()):
(WebCore::HandleDeleter<PlatformCommandBuffer>::operator()):
(WebCore::HandleDeleter<PlatformComputePassEncoder>::operator()):
(WebCore::HandleDeleter<PlatformComputePipeline>::operator()):
(WebCore::HandleDeleter<PlatformDevice>::operator()):
(WebCore::HandleDeleter<PlatformDrawable>::operator()):
(WebCore::HandleDeleter<PlatformProgrammablePassEncoder>::operator()):
(WebCore::HandleDeleter<PlatformQueue>::operator()):
(WebCore::HandleDeleter<PlatformRenderPassEncoder>::operator()):
(WebCore::HandleDeleter<PlatformRenderPipeline>::operator()):
(WebCore::HandleDeleter<PlatformSampler>::operator()):
(WebCore::HandleDeleter<PlatformShaderModule>::operator()):
(WebCore::HandleDeleter<PlatformSwapLayer>::operator()):
(WebCore::HandleDeleter<PlatformTexture>::operator()):
* platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUProgrammablePassEncoder::endPass):
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUQueue::tryCreate):
(WebCore::GPUQueue::GPUQueue):
(WebCore::GPUQueue::submit):
(WebCore::GPUQueue::label const):
(WebCore::GPUQueue::setLabel const):
* platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Added.
(WebCore::GPURenderPassEncoder::tryCreate):
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::setPipeline):
(WebCore::GPURenderPassEncoder::setBlendColor):
(WebCore::GPURenderPassEncoder::setViewport):
(WebCore::GPURenderPassEncoder::setScissorRect):
(WebCore::GPURenderPassEncoder::setIndexBuffer):
(WebCore::GPURenderPassEncoder::setVertexBuffers):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::GPURenderPassEncoder::drawIndexed):
* platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::recompile):
* platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUSampler::tryCreate):
(WebCore::GPUSampler::GPUSampler):
* platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUShaderModule::tryCreate):
(WebCore::GPUShaderModule::GPUShaderModule):
* platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUSwapChain::tryCreate):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::tryGetCurrentTexture):
(WebCore::GPUSwapChain::present):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::platformLayer const):
* platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
(WebCore::GPUTexture::tryCreate):
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::tryCreateDefaultTextureView):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (268868 => 268869)


--- trunk/Source/WebCore/ChangeLog	2020-10-22 16:23:07 UTC (rev 268868)
+++ trunk/Source/WebCore/ChangeLog	2020-10-22 16:47:20 UTC (rev 268869)
@@ -1,3 +1,118 @@
+2020-10-22  Don Olmstead  <[email protected]>
+
+        [WebGPU] Add Dawn implementation skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=217982
+
+        Reviewed by Myles C. Maxfield.
+
+        Add an empty implementation of the WebGPU types. This gets WebGPU built and linking
+        using Dawn.
+
+        * PlatformWinCairo.cmake:
+        * platform/Dawn.cmake: Added.
+        * platform/graphics/gpu/GPUPlatformTypes.h:
+        * platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUBindGroupAllocator::create):
+        (WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator):
+        (WebCore::GPUBindGroupAllocator::reallocate):
+        (WebCore::GPUBindGroupAllocator::tryReset):
+        * platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUBindGroup::tryCreate):
+        (WebCore::GPUBindGroup::GPUBindGroup):
+        (WebCore::GPUBindGroup::~GPUBindGroup):
+        * platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUBindGroupLayout::tryCreate):
+        * platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Added.
+        (WebCore::GPUBuffer::tryCreate):
+        (WebCore::GPUBuffer::GPUBuffer):
+        (WebCore::GPUBuffer::~GPUBuffer):
+        (WebCore::GPUBuffer::isReadOnly const):
+        (WebCore::GPUBuffer::state const):
+        (WebCore::GPUBuffer::mapOnCreation):
+        (WebCore::GPUBuffer::registerMappingCallback):
+        (WebCore::GPUBuffer::runMappingCallback):
+        (WebCore::GPUBuffer::stagingBufferForRead):
+        (WebCore::GPUBuffer::stagingBufferForWrite):
+        (WebCore::GPUBuffer::copyStagingBufferToGPU):
+        (WebCore::GPUBuffer::unmap):
+        (WebCore::GPUBuffer::destroy):
+        * platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUCommandBuffer::tryCreate):
+        (WebCore::GPUCommandBuffer::GPUCommandBuffer):
+        (WebCore::GPUCommandBuffer::copyBufferToBuffer):
+        (WebCore::GPUCommandBuffer::copyBufferToTexture):
+        (WebCore::GPUCommandBuffer::copyTextureToBuffer):
+        (WebCore::GPUCommandBuffer::copyTextureToTexture):
+        * platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUComputePassEncoder::tryCreate):
+        (WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
+        (WebCore::GPUComputePassEncoder::setPipeline):
+        (WebCore::GPUComputePassEncoder::dispatch):
+        (WebCore::GPUComputePassEncoder::platformPassEncoder const):
+        * platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUComputePipeline::tryCreate):
+        (WebCore::GPUComputePipeline::recompile):
+        * platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUDevice::tryCreate):
+        (WebCore::GPUDevice::GPUDevice):
+        * platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Added.
+        (WebCore::HandleDeleter<PlatformBuffer>::operator()):
+        (WebCore::HandleDeleter<PlatformCommandBuffer>::operator()):
+        (WebCore::HandleDeleter<PlatformComputePassEncoder>::operator()):
+        (WebCore::HandleDeleter<PlatformComputePipeline>::operator()):
+        (WebCore::HandleDeleter<PlatformDevice>::operator()):
+        (WebCore::HandleDeleter<PlatformDrawable>::operator()):
+        (WebCore::HandleDeleter<PlatformProgrammablePassEncoder>::operator()):
+        (WebCore::HandleDeleter<PlatformQueue>::operator()):
+        (WebCore::HandleDeleter<PlatformRenderPassEncoder>::operator()):
+        (WebCore::HandleDeleter<PlatformRenderPipeline>::operator()):
+        (WebCore::HandleDeleter<PlatformSampler>::operator()):
+        (WebCore::HandleDeleter<PlatformShaderModule>::operator()):
+        (WebCore::HandleDeleter<PlatformSwapLayer>::operator()):
+        (WebCore::HandleDeleter<PlatformTexture>::operator()):
+        * platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUProgrammablePassEncoder::endPass):
+        (WebCore::GPUProgrammablePassEncoder::setBindGroup):
+        * platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUQueue::tryCreate):
+        (WebCore::GPUQueue::GPUQueue):
+        (WebCore::GPUQueue::submit):
+        (WebCore::GPUQueue::label const):
+        (WebCore::GPUQueue::setLabel const):
+        * platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Added.
+        (WebCore::GPURenderPassEncoder::tryCreate):
+        (WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
+        (WebCore::GPURenderPassEncoder::platformPassEncoder const):
+        (WebCore::GPURenderPassEncoder::setPipeline):
+        (WebCore::GPURenderPassEncoder::setBlendColor):
+        (WebCore::GPURenderPassEncoder::setViewport):
+        (WebCore::GPURenderPassEncoder::setScissorRect):
+        (WebCore::GPURenderPassEncoder::setIndexBuffer):
+        (WebCore::GPURenderPassEncoder::setVertexBuffers):
+        (WebCore::GPURenderPassEncoder::draw):
+        (WebCore::GPURenderPassEncoder::drawIndexed):
+        * platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPURenderPipeline::tryCreate):
+        (WebCore::GPURenderPipeline::recompile):
+        * platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUSampler::tryCreate):
+        (WebCore::GPUSampler::GPUSampler):
+        * platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUShaderModule::tryCreate):
+        (WebCore::GPUShaderModule::GPUShaderModule):
+        * platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUSwapChain::tryCreate):
+        (WebCore::GPUSwapChain::GPUSwapChain):
+        (WebCore::GPUSwapChain::tryGetCurrentTexture):
+        (WebCore::GPUSwapChain::present):
+        (WebCore::GPUSwapChain::reshape):
+        (WebCore::GPUSwapChain::platformLayer const):
+        * platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
+        (WebCore::GPUTexture::tryCreate):
+        (WebCore::GPUTexture::create):
+        (WebCore::GPUTexture::GPUTexture):
+        (WebCore::GPUTexture::tryCreateDefaultTextureView):
+
 2020-10-22  Chris Dumez  <[email protected]>
 
         Turn ScriptExecutionContext::vm() into a pure virtual function

Modified: trunk/Source/WebCore/PlatformWinCairo.cmake (268868 => 268869)


--- trunk/Source/WebCore/PlatformWinCairo.cmake	2020-10-22 16:23:07 UTC (rev 268868)
+++ trunk/Source/WebCore/PlatformWinCairo.cmake	2020-10-22 16:47:20 UTC (rev 268869)
@@ -4,6 +4,10 @@
 include(platform/OpenSSL.cmake)
 include(platform/TextureMapper.cmake)
 
+if (USE_DAWN)
+    include(platform/Dawn.cmake)
+endif ()
+
 list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
     "${WEBKIT_LIBRARIES_DIR}/include"
     "${WEBCORE_DIR}/loader/archive/cf"

Added: trunk/Source/WebCore/platform/Dawn.cmake (0 => 268869)


--- trunk/Source/WebCore/platform/Dawn.cmake	                        (rev 0)
+++ trunk/Source/WebCore/platform/Dawn.cmake	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,27 @@
+list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
+    "${WEBCORE_DIR}/platform/graphics/gpu/dawn"
+)
+
+list(APPEND WebCore_SOURCES
+    platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp
+    platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp
+    platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp
+    platform/graphics/gpu/dawn/GPUBufferDawn.cpp
+    platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp
+    platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp
+    platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp
+    platform/graphics/gpu/dawn/GPUDeviceDawn.cpp
+    platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp
+    platform/graphics/gpu/dawn/GPUQueueDawn.cpp
+    platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp
+    platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp
+    platform/graphics/gpu/dawn/GPUSamplerDawn.cpp
+    platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp
+    platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp
+    platform/graphics/gpu/dawn/GPUTextureDawn.cpp
+)
+
+list(APPEND WebCore_PRIVATE_LIBRARIES
+    Dawn::dawn
+    Dawn::native
+)

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h (268868 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h	2020-10-22 16:23:07 UTC (rev 268868)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h	2020-10-22 16:47:20 UTC (rev 268869)
@@ -27,6 +27,8 @@
 
 #if USE(METAL)
 #include "GPUPlatformTypesMetal.h"
+#elif USE(DAWN)
+#include "GPUPlatformTypesDawn.h"
 #else
 #error "Unsupported platform for WebGPU"
 #endif

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUBindGroupAllocator.h"
+
+#if ENABLE(WEBGPU)
+
+#include "GPUErrorScopes.h"
+
+namespace WebCore {
+
+Ref<GPUBindGroupAllocator> GPUBindGroupAllocator::create(GPUErrorScopes& errors)
+{
+    return adoptRef(*new GPUBindGroupAllocator(errors));
+}
+
+GPUBindGroupAllocator::GPUBindGroupAllocator(GPUErrorScopes& errors)
+    : m_errorScopes(makeRef(errors))
+{
+}
+
+bool GPUBindGroupAllocator::reallocate(PlatformGPUBufferOffset newOffset)
+{
+    return false;
+}
+
+void GPUBindGroupAllocator::tryReset()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUBindGroup.h"
+
+#if ENABLE(WEBGPU)
+
+#include "GPUBindGroupAllocator.h"
+#include "GPUErrorScopes.h"
+#include <webgpu/webgpu.h>
+
+namespace WebCore {
+
+RefPtr<GPUBindGroup> GPUBindGroup::tryCreate(const GPUBindGroupDescriptor& descriptor, GPUBindGroupAllocator& allocator)
+{
+    return nullptr;
+}
+
+GPUBindGroup::GPUBindGroup(GPUBindGroupAllocator::ArgumentBufferOffsets&& offsets, GPUBindGroupAllocator& allocator, HashSet<Ref<GPUBuffer>>&& buffers, HashSet<Ref<GPUTexture>>&& textures)
+    : m_argumentBufferOffsets(WTFMove(offsets))
+    , m_allocator(makeRef(allocator))
+    , m_boundBuffers(WTFMove(buffers))
+    , m_boundTextures(WTFMove(textures))
+{
+}
+
+GPUBindGroup::~GPUBindGroup()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUBindGroupLayout.h"
+
+#if ENABLE(WEBGPU)
+
+#include "GPUDevice.h"
+#include <webgpu/webgpu.h>
+
+namespace WebCore {
+
+RefPtr<GPUBindGroupLayout> GPUBindGroupLayout::tryCreate(const GPUDevice& device, const GPUBindGroupLayoutDescriptor& descriptor)
+{
+    return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Added: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBufferDawn.cpp (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBufferDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBufferDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUBuffer.h"
+
+#if ENABLE(WEBGPU)
+
+#include "GPUBufferDescriptor.h"
+#include "GPUDevice.h"
+#include <_javascript_Core/ArrayBuffer.h>
+
+namespace WebCore {
+
+RefPtr<GPUBuffer> GPUBuffer::tryCreate(GPUDevice& device, const GPUBufferDescriptor& descriptor, GPUBufferMappedOption isMapped, GPUErrorScopes& errorScopes)
+{
+    return nullptr;
+}
+
+GPUBuffer::GPUBuffer(PlatformBufferSmartPtr&& buffer, GPUDevice& device, size_t size, OptionSet<GPUBufferUsage::Flags> usage, GPUBufferMappedOption isMapped)
+    : m_platformBuffer(WTFMove(buffer))
+    , m_device(makeRef(device))
+    , m_byteLength(size)
+    , m_usage(usage)
+    , m_isMappedFromCreation(isMapped == GPUBufferMappedOption::IsMapped)
+{
+}
+
+GPUBuffer::~GPUBuffer()
+{
+    destroy(nullptr);
+}
+
+bool GPUBuffer::isReadOnly() const
+{
+    return true;
+}
+
+GPUBuffer::State GPUBuffer::state() const
+{
+    return State::Unmapped;
+}
+
+JSC::ArrayBuffer* GPUBuffer::mapOnCreation()
+{
+    return nullptr;
+}
+
+void GPUBuffer::registerMappingCallback(MappingCallback&& callback, bool isRead, GPUErrorScopes& errorScopes)
+{
+}
+
+void GPUBuffer::runMappingCallback()
+{
+}
+
+JSC::ArrayBuffer* GPUBuffer::stagingBufferForRead()
+{
+    return nullptr;
+}
+
+JSC::ArrayBuffer* GPUBuffer::stagingBufferForWrite()
+{
+    return nullptr;
+}
+
+void GPUBuffer::copyStagingBufferToGPU(GPUErrorScopes* errorScopes)
+{
+}
+
+void GPUBuffer::unmap(GPUErrorScopes* errorScopes)
+{
+}
+
+void GPUBuffer::destroy(GPUErrorScopes* errorScopes)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUCommandBuffer.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUCommandBuffer> GPUCommandBuffer::tryCreate(const GPUDevice& device)
+{
+    return nullptr;
+}
+
+GPUCommandBuffer::GPUCommandBuffer(PlatformCommandBufferSmartPtr&& buffer)
+    : m_platformCommandBuffer(WTFMove(buffer))
+{
+}
+
+void GPUCommandBuffer::copyBufferToBuffer(Ref<GPUBuffer>&& src, uint64_t srcOffset, Ref<GPUBuffer>&& dst, uint64_t dstOffset, uint64_t size)
+{
+}
+
+void GPUCommandBuffer::copyBufferToTexture(GPUBufferCopyView&& srcBuffer, GPUTextureCopyView&& dstTexture, const GPUExtent3D& size)
+{
+}
+
+void GPUCommandBuffer::copyTextureToBuffer(GPUTextureCopyView&& srcTexture, GPUBufferCopyView&& dstBuffer, const GPUExtent3D& size)
+{
+}
+
+void GPUCommandBuffer::copyTextureToTexture(GPUTextureCopyView&& src, GPUTextureCopyView&& dst, const GPUExtent3D& size)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUComputePassEncoder.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUComputePassEncoder> GPUComputePassEncoder::tryCreate(Ref<GPUCommandBuffer>&& buffer)
+{
+    return nullptr;
+}
+
+GPUComputePassEncoder::GPUComputePassEncoder(Ref<GPUCommandBuffer>&& buffer, PlatformComputePassEncoderSmartPtr&& encoder)
+    : GPUProgrammablePassEncoder(WTFMove(buffer))
+    , m_platformComputePassEncoder(WTFMove(encoder))
+{
+}
+
+void GPUComputePassEncoder::setPipeline(Ref<const GPUComputePipeline>&& pipeline)
+{
+}
+
+void GPUComputePassEncoder::dispatch(unsigned x, unsigned y, unsigned z)
+{
+}
+
+const PlatformProgrammablePassEncoder* GPUComputePassEncoder::platformPassEncoder() const
+{
+    return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUComputePipeline.h"
+
+#if ENABLE(WEBGPU)
+
+#include "GPUPipelineLayout.h"
+
+namespace WebCore {
+
+RefPtr<GPUComputePipeline> GPUComputePipeline::tryCreate(const GPUDevice& device, const GPUComputePipelineDescriptor& descriptor, GPUErrorScopes& errorScopes)
+{
+    return nullptr;
+}
+
+GPUComputePipeline::~GPUComputePipeline() = default;
+
+bool GPUComputePipeline::recompile(const GPUDevice& device, GPUProgrammableStageDescriptor&& computeStage)
+{
+    return false;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUDeviceDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUDeviceDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUDeviceDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUDevice.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUDevice> GPUDevice::tryCreate(const Optional<GPURequestAdapterOptions>& options)
+{
+    return nullptr;
+}
+
+GPUDevice::GPUDevice(PlatformDeviceSmartPtr&& device)
+    : m_platformDevice(WTFMove(device))
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Added: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,198 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <memory>
+#include <webgpu/webgpu.h>
+
+namespace WebCore {
+
+using PlatformGPUBufferOffset = std::uint64_t;
+
+// Dawn types
+using PlatformBuffer = WGPUBufferImpl;
+using PlatformCommandBuffer = WGPUCommandBufferImpl;
+using PlatformComputePassEncoder = WGPUComputePassEncoderImpl;
+using PlatformComputePipeline = WGPUComputePipelineImpl;
+using PlatformDevice = WGPUDeviceImpl;
+using PlatformDrawable = WGPUSurfaceImpl;
+using PlatformProgrammablePassEncoder = WGPUCommandEncoderImpl;
+using PlatformQueue = WGPUQueueImpl;
+using PlatformRenderPassEncoder = WGPURenderPassEncoderImpl;
+using PlatformRenderPipeline = WGPURenderPipelineImpl;
+using PlatformSampler = WGPUSamplerImpl;
+using PlatformShaderModule = WGPUShaderModuleImpl;
+using PlatformSwapLayer = WGPUSwapChainImpl;
+using PlatformTexture = WGPUTextureImpl;
+
+template<typename T>
+struct HandleDeleter {
+public:
+    void operator()(T* handle) = delete;
+};
+
+template<>
+struct HandleDeleter<PlatformBuffer> {
+    void operator()(PlatformBuffer* handle)
+    {
+        if (handle)
+            wgpuBufferDestroy(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformCommandBuffer> {
+    void operator()(PlatformCommandBuffer* handle)
+    {
+        if (handle)
+            wgpuCommandBufferRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformComputePassEncoder> {
+    void operator()(PlatformComputePassEncoder* handle)
+    {
+        if (handle)
+            wgpuComputePassEncoderRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformComputePipeline> {
+    void operator()(PlatformComputePipeline* handle)
+    {
+        if (handle)
+            wgpuComputePipelineRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformDevice> {
+    void operator()(PlatformDevice* handle)
+    {
+        if (handle)
+            wgpuDeviceRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformDrawable> {
+    void operator()(PlatformDrawable* handle)
+    {
+        if (handle)
+            wgpuSurfaceRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformProgrammablePassEncoder> {
+    void operator()(PlatformProgrammablePassEncoder* handle)
+    {
+        if (handle)
+            wgpuCommandEncoderRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformQueue> {
+    void operator()(PlatformQueue* handle)
+    {
+        if (handle)
+            wgpuQueueRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformRenderPassEncoder> {
+    void operator()(PlatformRenderPassEncoder* handle)
+    {
+        if (handle)
+            wgpuRenderPassEncoderRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformRenderPipeline> {
+    void operator()(PlatformRenderPipeline* handle)
+    {
+        if (handle)
+            wgpuRenderPipelineRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformSampler> {
+    void operator()(PlatformSampler* handle)
+    {
+        if (handle)
+            wgpuSamplerRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformShaderModule> {
+    void operator()(PlatformShaderModule* handle)
+    {
+        if (handle)
+            wgpuShaderModuleRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformSwapLayer> {
+    void operator()(PlatformSwapLayer* handle)
+    {
+        if (handle)
+            wgpuSwapChainRelease(handle);
+    }
+};
+
+template<>
+struct HandleDeleter<PlatformTexture> {
+    void operator()(PlatformTexture* handle)
+    {
+        if (handle)
+            wgpuTextureRelease(handle);
+    }
+};
+
+using PlatformBufferSmartPtr = std::unique_ptr<PlatformBuffer, HandleDeleter<PlatformBuffer>>;
+using PlatformCommandBufferSmartPtr = std::unique_ptr<PlatformCommandBuffer, HandleDeleter<PlatformCommandBuffer>>;
+using PlatformComputePassEncoderSmartPtr = std::unique_ptr<PlatformComputePassEncoder, HandleDeleter<PlatformComputePassEncoder>>;
+using PlatformComputePipelineSmartPtr = std::unique_ptr<PlatformComputePipeline, HandleDeleter<PlatformComputePipeline>>;
+using PlatformDeviceSmartPtr = std::unique_ptr<PlatformDevice, HandleDeleter<PlatformDevice>>;
+using PlatformDrawableSmartPtr = std::unique_ptr<PlatformDrawable, HandleDeleter<PlatformDrawable>>;
+using PlatformProgrammablePassEncoderSmartPtr = std::unique_ptr<PlatformProgrammablePassEncoder, HandleDeleter<PlatformProgrammablePassEncoder>>;
+using PlatformQueueSmartPtr = std::unique_ptr<PlatformQueue, HandleDeleter<PlatformQueue>>;
+using PlatformRenderPassEncoderSmartPtr = std::unique_ptr<PlatformRenderPassEncoder, HandleDeleter<PlatformRenderPassEncoder>>;
+using PlatformRenderPipelineSmartPtr = std::unique_ptr<PlatformRenderPipeline, HandleDeleter<PlatformRenderPipeline>>;
+using PlatformSamplerSmartPtr = std::unique_ptr<PlatformSampler, HandleDeleter<PlatformSampler>>;
+using PlatformShaderModuleSmartPtr = std::unique_ptr<PlatformShaderModule, HandleDeleter<PlatformShaderModule>>;
+using PlatformSwapLayerSmartPtr = std::unique_ptr<PlatformSwapLayer, HandleDeleter<PlatformSwapLayer>>;
+using PlatformTextureSmartPtr = std::unique_ptr<PlatformTexture, HandleDeleter<PlatformTexture>>;
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUProgrammablePassEncoder.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+void GPUProgrammablePassEncoder::endPass()
+{
+}
+
+void GPUProgrammablePassEncoder::setBindGroup(unsigned index, GPUBindGroup& bindGroup)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUQueueDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUQueueDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUQueueDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUQueue.h"
+
+#if ENABLE(WEBGPU)
+
+#include "GPUDevice.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+RefPtr<GPUQueue> GPUQueue::tryCreate(const GPUDevice& device)
+{
+    return nullptr;
+}
+
+GPUQueue::GPUQueue(PlatformQueueSmartPtr&& queue, const GPUDevice& device)
+    : m_platformQueue(WTFMove(queue))
+    , m_device(makeWeakPtr(device))
+{
+}
+
+void GPUQueue::submit(Vector<Ref<GPUCommandBuffer>>&& commandBuffers)
+{
+}
+
+String GPUQueue::label() const
+{
+    return emptyString();
+}
+
+void GPUQueue::setLabel(const String& label) const
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Added: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPURenderPassEncoder.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPURenderPassEncoder> GPURenderPassEncoder::tryCreate(Ref<GPUCommandBuffer>&& buffer, GPURenderPassDescriptor&& descriptor)
+{
+    return nullptr;
+}
+
+GPURenderPassEncoder::GPURenderPassEncoder(Ref<GPUCommandBuffer>&& commandBuffer, PlatformRenderPassEncoderSmartPtr&& encoder)
+    : GPUProgrammablePassEncoder(WTFMove(commandBuffer))
+    , m_platformRenderPassEncoder(WTFMove(encoder))
+{
+}
+
+const PlatformProgrammablePassEncoder* GPURenderPassEncoder::platformPassEncoder() const
+{
+    return nullptr;
+}
+
+void GPURenderPassEncoder::setPipeline(Ref<const GPURenderPipeline>&& pipeline)
+{
+}
+
+void GPURenderPassEncoder::setBlendColor(const GPUColor& color)
+{
+}
+
+void GPURenderPassEncoder::setViewport(float x, float y, float width, float height, float minDepth, float maxDepth)
+{
+}
+
+void GPURenderPassEncoder::setScissorRect(unsigned x, unsigned y, unsigned width, unsigned height)
+{
+}
+
+void GPURenderPassEncoder::setIndexBuffer(GPUBuffer& buffer, uint64_t offset)
+{
+}
+
+void GPURenderPassEncoder::setVertexBuffers(unsigned index, const Vector<Ref<GPUBuffer>>& buffers, const Vector<uint64_t>& offsets)
+{
+}
+
+void GPURenderPassEncoder::draw(unsigned vertexCount, unsigned instanceCount, unsigned firstVertex, unsigned firstInstance)
+{
+}
+
+void GPURenderPassEncoder::drawIndexed(unsigned indexCount, unsigned instanceCount, unsigned firstIndex, int baseVertex, unsigned firstInstance)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPURenderPipeline.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPURenderPipeline> GPURenderPipeline::tryCreate(const GPUDevice& device, const GPURenderPipelineDescriptor& descriptor, GPUErrorScopes& errorScopes)
+{
+    return nullptr;
+}
+
+GPURenderPipeline::~GPURenderPipeline() = default;
+
+bool GPURenderPipeline::recompile(const GPUDevice& device, GPUProgrammableStageDescriptor&& vertexStage, Optional<GPUProgrammableStageDescriptor>&& fragmentStage)
+{
+    return false;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSamplerDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSamplerDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSamplerDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUSampler.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUSampler> GPUSampler::tryCreate(const GPUDevice& device, const GPUSamplerDescriptor& descriptor)
+{
+    return nullptr;
+}
+
+GPUSampler::GPUSampler(PlatformSamplerSmartPtr&& sampler)
+    : m_platformSampler(WTFMove(sampler))
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUShaderModule.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUShaderModule> GPUShaderModule::tryCreate(const GPUDevice& device, const GPUShaderModuleDescriptor& descriptor)
+{
+    return nullptr;
+}
+
+GPUShaderModule::GPUShaderModule(PlatformShaderModuleSmartPtr&& module)
+    : m_platformShaderModule(WTFMove(module))
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUSwapChain.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUSwapChain> GPUSwapChain::tryCreate(const GPUSwapChainDescriptor& descriptor, int width, int height)
+{
+    return nullptr;
+}
+
+GPUSwapChain::GPUSwapChain(PlatformSwapLayerSmartPtr&& platformLayer, OptionSet<GPUTextureUsage::Flags> usageOptions)
+    : m_platformSwapLayer(WTFMove(platformLayer))
+    , m_usage(usageOptions)
+{
+}
+
+RefPtr<GPUTexture> GPUSwapChain::tryGetCurrentTexture()
+{
+    return nullptr;
+}
+
+void GPUSwapChain::present()
+{
+    if (!m_currentDrawable)
+        return;
+}
+
+void GPUSwapChain::reshape(int width, int height)
+{
+
+}
+
+PlatformLayer* GPUSwapChain::platformLayer() const
+{
+    return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUTextureDawn.cpp (from rev 268868, trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h) (0 => 268869)


--- trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUTextureDawn.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUTextureDawn.cpp	2020-10-22 16:47:20 UTC (rev 268869)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2020 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GPUTexture.h"
+
+#if ENABLE(WEBGPU)
+
+namespace WebCore {
+
+RefPtr<GPUTexture> GPUTexture::tryCreate(const GPUDevice& device, const GPUTextureDescriptor& descriptor, GPUErrorScopes& errorScopes)
+{
+    return nullptr;
+}
+
+Ref<GPUTexture> GPUTexture::create(PlatformTextureSmartPtr&& texture, OptionSet<GPUTextureUsage::Flags> usage)
+{
+    return adoptRef(*new GPUTexture(WTFMove(texture), usage));
+}
+
+GPUTexture::GPUTexture(PlatformTextureSmartPtr&& texture, OptionSet<GPUTextureUsage::Flags> usage)
+    : m_platformTexture(WTFMove(texture))
+    , m_usage(usage)
+{
+}
+
+RefPtr<GPUTexture> GPUTexture::tryCreateDefaultTextureView()
+{
+    return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to