Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 4bd41f5

Browse files
[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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@268869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 552a4ee commit 4bd41f5

21 files changed

+1266
-0
lines changed

Source/WebCore/ChangeLog

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,118 @@
1+
2020-10-22 Don Olmstead <[email protected]>
2+
3+
[WebGPU] Add Dawn implementation skeleton
4+
https://bugs.webkit.org/show_bug.cgi?id=217982
5+
6+
Reviewed by Myles C. Maxfield.
7+
8+
Add an empty implementation of the WebGPU types. This gets WebGPU built and linking
9+
using Dawn.
10+
11+
* PlatformWinCairo.cmake:
12+
* platform/Dawn.cmake: Added.
13+
* platform/graphics/gpu/GPUPlatformTypes.h:
14+
* platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
15+
(WebCore::GPUBindGroupAllocator::create):
16+
(WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator):
17+
(WebCore::GPUBindGroupAllocator::reallocate):
18+
(WebCore::GPUBindGroupAllocator::tryReset):
19+
* platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
20+
(WebCore::GPUBindGroup::tryCreate):
21+
(WebCore::GPUBindGroup::GPUBindGroup):
22+
(WebCore::GPUBindGroup::~GPUBindGroup):
23+
* platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
24+
(WebCore::GPUBindGroupLayout::tryCreate):
25+
* platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Added.
26+
(WebCore::GPUBuffer::tryCreate):
27+
(WebCore::GPUBuffer::GPUBuffer):
28+
(WebCore::GPUBuffer::~GPUBuffer):
29+
(WebCore::GPUBuffer::isReadOnly const):
30+
(WebCore::GPUBuffer::state const):
31+
(WebCore::GPUBuffer::mapOnCreation):
32+
(WebCore::GPUBuffer::registerMappingCallback):
33+
(WebCore::GPUBuffer::runMappingCallback):
34+
(WebCore::GPUBuffer::stagingBufferForRead):
35+
(WebCore::GPUBuffer::stagingBufferForWrite):
36+
(WebCore::GPUBuffer::copyStagingBufferToGPU):
37+
(WebCore::GPUBuffer::unmap):
38+
(WebCore::GPUBuffer::destroy):
39+
* platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
40+
(WebCore::GPUCommandBuffer::tryCreate):
41+
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
42+
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
43+
(WebCore::GPUCommandBuffer::copyBufferToTexture):
44+
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
45+
(WebCore::GPUCommandBuffer::copyTextureToTexture):
46+
* platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
47+
(WebCore::GPUComputePassEncoder::tryCreate):
48+
(WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
49+
(WebCore::GPUComputePassEncoder::setPipeline):
50+
(WebCore::GPUComputePassEncoder::dispatch):
51+
(WebCore::GPUComputePassEncoder::platformPassEncoder const):
52+
* platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
53+
(WebCore::GPUComputePipeline::tryCreate):
54+
(WebCore::GPUComputePipeline::recompile):
55+
* platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
56+
(WebCore::GPUDevice::tryCreate):
57+
(WebCore::GPUDevice::GPUDevice):
58+
* platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Added.
59+
(WebCore::HandleDeleter<PlatformBuffer>::operator()):
60+
(WebCore::HandleDeleter<PlatformCommandBuffer>::operator()):
61+
(WebCore::HandleDeleter<PlatformComputePassEncoder>::operator()):
62+
(WebCore::HandleDeleter<PlatformComputePipeline>::operator()):
63+
(WebCore::HandleDeleter<PlatformDevice>::operator()):
64+
(WebCore::HandleDeleter<PlatformDrawable>::operator()):
65+
(WebCore::HandleDeleter<PlatformProgrammablePassEncoder>::operator()):
66+
(WebCore::HandleDeleter<PlatformQueue>::operator()):
67+
(WebCore::HandleDeleter<PlatformRenderPassEncoder>::operator()):
68+
(WebCore::HandleDeleter<PlatformRenderPipeline>::operator()):
69+
(WebCore::HandleDeleter<PlatformSampler>::operator()):
70+
(WebCore::HandleDeleter<PlatformShaderModule>::operator()):
71+
(WebCore::HandleDeleter<PlatformSwapLayer>::operator()):
72+
(WebCore::HandleDeleter<PlatformTexture>::operator()):
73+
* platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
74+
(WebCore::GPUProgrammablePassEncoder::endPass):
75+
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
76+
* platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
77+
(WebCore::GPUQueue::tryCreate):
78+
(WebCore::GPUQueue::GPUQueue):
79+
(WebCore::GPUQueue::submit):
80+
(WebCore::GPUQueue::label const):
81+
(WebCore::GPUQueue::setLabel const):
82+
* platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Added.
83+
(WebCore::GPURenderPassEncoder::tryCreate):
84+
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
85+
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
86+
(WebCore::GPURenderPassEncoder::setPipeline):
87+
(WebCore::GPURenderPassEncoder::setBlendColor):
88+
(WebCore::GPURenderPassEncoder::setViewport):
89+
(WebCore::GPURenderPassEncoder::setScissorRect):
90+
(WebCore::GPURenderPassEncoder::setIndexBuffer):
91+
(WebCore::GPURenderPassEncoder::setVertexBuffers):
92+
(WebCore::GPURenderPassEncoder::draw):
93+
(WebCore::GPURenderPassEncoder::drawIndexed):
94+
* platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
95+
(WebCore::GPURenderPipeline::tryCreate):
96+
(WebCore::GPURenderPipeline::recompile):
97+
* platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
98+
(WebCore::GPUSampler::tryCreate):
99+
(WebCore::GPUSampler::GPUSampler):
100+
* platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
101+
(WebCore::GPUShaderModule::tryCreate):
102+
(WebCore::GPUShaderModule::GPUShaderModule):
103+
* platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
104+
(WebCore::GPUSwapChain::tryCreate):
105+
(WebCore::GPUSwapChain::GPUSwapChain):
106+
(WebCore::GPUSwapChain::tryGetCurrentTexture):
107+
(WebCore::GPUSwapChain::present):
108+
(WebCore::GPUSwapChain::reshape):
109+
(WebCore::GPUSwapChain::platformLayer const):
110+
* platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
111+
(WebCore::GPUTexture::tryCreate):
112+
(WebCore::GPUTexture::create):
113+
(WebCore::GPUTexture::GPUTexture):
114+
(WebCore::GPUTexture::tryCreateDefaultTextureView):
115+
1116
2020-10-22 Chris Dumez <[email protected]>
2117

3118
Turn ScriptExecutionContext::vm() into a pure virtual function

Source/WebCore/PlatformWinCairo.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ include(platform/ImageDecoders.cmake)
44
include(platform/OpenSSL.cmake)
55
include(platform/TextureMapper.cmake)
66

7+
if (USE_DAWN)
8+
include(platform/Dawn.cmake)
9+
endif ()
10+
711
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
812
"${WEBKIT_LIBRARIES_DIR}/include"
913
"${WEBCORE_DIR}/loader/archive/cf"

Source/WebCore/platform/Dawn.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
2+
"${WEBCORE_DIR}/platform/graphics/gpu/dawn"
3+
)
4+
5+
list(APPEND WebCore_SOURCES
6+
platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp
7+
platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp
8+
platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp
9+
platform/graphics/gpu/dawn/GPUBufferDawn.cpp
10+
platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp
11+
platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp
12+
platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp
13+
platform/graphics/gpu/dawn/GPUDeviceDawn.cpp
14+
platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp
15+
platform/graphics/gpu/dawn/GPUQueueDawn.cpp
16+
platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp
17+
platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp
18+
platform/graphics/gpu/dawn/GPUSamplerDawn.cpp
19+
platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp
20+
platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp
21+
platform/graphics/gpu/dawn/GPUTextureDawn.cpp
22+
)
23+
24+
list(APPEND WebCore_PRIVATE_LIBRARIES
25+
Dawn::dawn
26+
Dawn::native
27+
)

Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#if USE(METAL)
2929
#include "GPUPlatformTypesMetal.h"
30+
#elif USE(DAWN)
31+
#include "GPUPlatformTypesDawn.h"
3032
#else
3133
#error "Unsupported platform for WebGPU"
3234
#endif
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (C) 2020 Sony Interactive Entertainment Inc.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23+
* THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#include "config.h"
27+
#include "GPUBindGroupAllocator.h"
28+
29+
#if ENABLE(WEBGPU)
30+
31+
#include "GPUErrorScopes.h"
32+
33+
namespace WebCore {
34+
35+
Ref<GPUBindGroupAllocator> GPUBindGroupAllocator::create(GPUErrorScopes& errors)
36+
{
37+
return adoptRef(*new GPUBindGroupAllocator(errors));
38+
}
39+
40+
GPUBindGroupAllocator::GPUBindGroupAllocator(GPUErrorScopes& errors)
41+
: m_errorScopes(makeRef(errors))
42+
{
43+
}
44+
45+
bool GPUBindGroupAllocator::reallocate(PlatformGPUBufferOffset newOffset)
46+
{
47+
return false;
48+
}
49+
50+
void GPUBindGroupAllocator::tryReset()
51+
{
52+
}
53+
54+
} // namespace WebCore
55+
56+
#endif // ENABLE(WEBGPU)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (C) 2019 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23+
* THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#include "config.h"
27+
#include "GPUBindGroup.h"
28+
29+
#if ENABLE(WEBGPU)
30+
31+
#include "GPUBindGroupAllocator.h"
32+
#include "GPUErrorScopes.h"
33+
#include <webgpu/webgpu.h>
34+
35+
namespace WebCore {
36+
37+
RefPtr<GPUBindGroup> GPUBindGroup::tryCreate(const GPUBindGroupDescriptor& descriptor, GPUBindGroupAllocator& allocator)
38+
{
39+
return nullptr;
40+
}
41+
42+
GPUBindGroup::GPUBindGroup(GPUBindGroupAllocator::ArgumentBufferOffsets&& offsets, GPUBindGroupAllocator& allocator, HashSet<Ref<GPUBuffer>>&& buffers, HashSet<Ref<GPUTexture>>&& textures)
43+
: m_argumentBufferOffsets(WTFMove(offsets))
44+
, m_allocator(makeRef(allocator))
45+
, m_boundBuffers(WTFMove(buffers))
46+
, m_boundTextures(WTFMove(textures))
47+
{
48+
}
49+
50+
GPUBindGroup::~GPUBindGroup()
51+
{
52+
}
53+
54+
} // namespace WebCore
55+
56+
#endif // ENABLE(WEBGPU)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (C) 2018 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23+
* THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#include "config.h"
27+
#include "GPUBindGroupLayout.h"
28+
29+
#if ENABLE(WEBGPU)
30+
31+
#include "GPUDevice.h"
32+
#include <webgpu/webgpu.h>
33+
34+
namespace WebCore {
35+
36+
RefPtr<GPUBindGroupLayout> GPUBindGroupLayout::tryCreate(const GPUDevice& device, const GPUBindGroupLayoutDescriptor& descriptor)
37+
{
38+
return nullptr;
39+
}
40+
41+
} // namespace WebCore
42+
43+
#endif // ENABLE(WEBGPU)

0 commit comments

Comments
 (0)