WebKit Bugzilla
Attachment 357600 Details for
Bug 192817
: [WebGPU] BindGroupLayout and Device::createBindGroupLayout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-192817-20181218131413.patch (text/plain), 29.21 KB, created by
Justin Fan
on 2018-12-18 13:14:14 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Justin Fan
Created:
2018-12-18 13:14:14 PST
Size:
29.21 KB
patch
obsolete
>Subversion Revision: 239289 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8c68b600bc7acffcba78aaffb40ad18a272711ca..4623558520b045ef40c4f60419f8fe1aff33f979 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2018-12-18 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] BindGroupLayout and Device::createBindGroupLayout >+ https://bugs.webkit.org/show_bug.cgi?id=192817 >+ >+ Reviewed by Dean Jackson. >+ >+ Update bind-group-layouts to test new functionality. >+ >+ Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout: >+ * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added. >+ (WebCore::WebGPUBindGroupLayout::create): >+ (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout): >+ * Modules/webgpu/WebGPUBindGroupLayout.h: Added. >+ * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now. >+ * Modules/webgpu/WebGPUDevice.cpp: >+ (WebCore::WebGPUDevice::createBindGroupLayout const): Added. >+ * Modules/webgpu/WebGPUDevice.h: >+ * Modules/webgpu/WebGPUDevice.idl: >+ * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added. >+ (WebCore::GPUBindGroupLayout::tryCreate): >+ (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): >+ * platform/graphics/gpu/GPUBindGroupLayout.h: Added. >+ * platform/graphics/gpu/GPUDevice.cpp: >+ (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added. >+ * platform/graphics/gpu/GPUDevice.h: >+ >+ Add files and symbols to project: >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/WebCoreBuiltinNames.h: >+ >+ Missing includes that were previously provided via UnifiedSources: >+ * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: >+ * platform/sql/SQLiteFileSystem.h: >+ > 2018-12-17 Daniel Bates <dabates@apple.com> > > Make DocumentMarker::allMarkers() constexpr >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index df7da0f84546b441a7302587fb7dac4e7b4a6b6f..b588c31868c9b7501991c220008af6e66388e542 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -458,6 +458,7 @@ set(WebCore_NON_SVG_IDL_FILES > Modules/webgpu/WebGPU.idl > Modules/webgpu/WebGPUAdapter.idl > Modules/webgpu/WebGPUAdapterDescriptor.idl >+ Modules/webgpu/WebGPUBindGroupLayout.idl > Modules/webgpu/WebGPUBindGroupLayoutBinding.idl > Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl > Modules/webgpu/WebGPUBuffer.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 321bd439a5e085f22900ee7268e7da09bb2bed27..de395b175e8885d4caf7e0df86ed820e8cd71cec 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -375,6 +375,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/Modules/webgpu/WebGPU.idl \ > $(WebCore)/Modules/webgpu/WebGPUAdapter.idl \ > $(WebCore)/Modules/webgpu/WebGPUAdapterDescriptor.idl \ >+ $(WebCore)/Modules/webgpu/WebGPUBindGroupLayout.idl \ > $(WebCore)/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl \ > $(WebCore)/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl \ > $(WebCore)/Modules/webgpu/WebGPUBuffer.idl \ >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..e152b7381c08c9523de10b781b03675d03de7b63 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp >@@ -0,0 +1,45 @@ >+/* >+ * 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 "WebGPUBindGroupLayout.h" >+ >+#if ENABLE(WEBGPU) >+ >+namespace WebCore { >+ >+Ref<WebGPUBindGroupLayout> WebGPUBindGroupLayout::create(Ref<GPUBindGroupLayout>&& layout) >+{ >+ return adoptRef(*new WebGPUBindGroupLayout(WTFMove(layout))); >+} >+ >+WebGPUBindGroupLayout::WebGPUBindGroupLayout(Ref<GPUBindGroupLayout>&& layout) >+ : m_layout(WTFMove(layout)) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7d71e0748957b96bd7da0ca23ba977948c38fd86 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h >@@ -0,0 +1,49 @@ >+/* >+ * 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. >+ */ >+ >+#pragma once >+ >+#if ENABLE(WEBGPU) >+ >+#include "GPUBindGroupLayout.h" >+ >+#include <wtf/Ref.h> >+#include <wtf/RefCounted.h> >+ >+namespace WebCore { >+ >+class WebGPUBindGroupLayout : public RefCounted<WebGPUBindGroupLayout> { >+public: >+ static Ref<WebGPUBindGroupLayout> create(Ref<GPUBindGroupLayout>&&); >+ >+private: >+ explicit WebGPUBindGroupLayout(Ref<GPUBindGroupLayout>&&); >+ >+ Ref<GPUBindGroupLayout> m_layout; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.idl b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..6742f98bc3ab48741d43a3074cfa94413c6ad603 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.idl >@@ -0,0 +1,32 @@ >+/* >+ * 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. >+ */ >+// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl >+ >+[ >+ Conditional=WEBGPU, >+ EnabledAtRuntime=WebGPU, >+ ImplementationLacksVTable >+] interface WebGPUBindGroupLayout { >+}; >diff --git a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >index 77ba4cbc08f96b1e322c69d487f705941286c438..e78451dd56b069b48b23e8b6d2fe6d3f52c91118 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >@@ -33,6 +33,7 @@ > #include "GPURenderPipelineDescriptor.h" > #include "GPUShaderModuleDescriptor.h" > #include "Logging.h" >+#include "WebGPUBindGroupLayout.h" > #include "WebGPUBuffer.h" > #include "WebGPUCommandBuffer.h" > #include "WebGPUPipelineStageDescriptor.h" >@@ -64,6 +65,12 @@ RefPtr<WebGPUBuffer> WebGPUDevice::createBuffer(WebGPUBufferDescriptor&& descrip > return buffer ? WebGPUBuffer::create(buffer.releaseNonNull()) : nullptr; > } > >+Ref<WebGPUBindGroupLayout> WebGPUDevice::createBindGroupLayout(WebGPUBindGroupLayoutDescriptor&& descriptor) const >+{ >+ auto layout = m_device->createBindGroupLayout(GPUBindGroupLayoutDescriptor { descriptor.bindings }); >+ return WebGPUBindGroupLayout::create(WTFMove(layout)); >+} >+ > RefPtr<WebGPUShaderModule> WebGPUDevice::createShaderModule(WebGPUShaderModuleDescriptor&& descriptor) const > { > // FIXME: What can be validated here? >diff --git a/Source/WebCore/Modules/webgpu/WebGPUDevice.h b/Source/WebCore/Modules/webgpu/WebGPUDevice.h >index 659b3ecf51a2904f79a91a59e670758a7a99adfb..30b2e8627d03a13559c54e427e3f22365f5a23da 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.h >@@ -29,6 +29,7 @@ > > #include "GPUDevice.h" > #include "WebGPUAdapter.h" >+#include "WebGPUBindGroupLayoutDescriptor.h" > #include "WebGPUBufferDescriptor.h" > #include "WebGPUQueue.h" > >@@ -39,6 +40,7 @@ > namespace WebCore { > > class ScriptExecutionContext; >+class WebGPUBindGroupLayout; > class WebGPUBuffer; > class WebGPUCommandBuffer; > class WebGPURenderPipeline; >@@ -56,6 +58,8 @@ public: > > RefPtr<WebGPUBuffer> createBuffer(WebGPUBufferDescriptor&&) const; > >+ Ref<WebGPUBindGroupLayout> createBindGroupLayout(WebGPUBindGroupLayoutDescriptor&&) const; >+ > RefPtr<WebGPUShaderModule> createShaderModule(WebGPUShaderModuleDescriptor&&) const; > RefPtr<WebGPURenderPipeline> createRenderPipeline(WebGPURenderPipelineDescriptor&&) const; > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUDevice.idl b/Source/WebCore/Modules/webgpu/WebGPUDevice.idl >index e098be915fd73b5904806b172d222b9f64e2427a..8348dfbdca7b171a65c852a26add83ebe1ced17c 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.idl >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.idl >@@ -35,6 +35,8 @@ > > WebGPUBuffer createBuffer(WebGPUBufferDescriptor descriptor); > >+ WebGPUBindGroupLayout createBindGroupLayout(WebGPUBindGroupLayoutDescriptor descriptor); >+ > WebGPUShaderModule createShaderModule(WebGPUShaderModuleDescriptor descriptor); > WebGPURenderPipeline createRenderPipeline(WebGPURenderPipelineDescriptor descriptor); > >@@ -47,7 +49,6 @@ > // WebGPUTexture createTexture(WebGPUTextureDescriptor descriptor); > // WebGPUSampler createSampler(WebGPUSamplerDescriptor descriptor); > // >- // WebGPUBindGroupLayout createBindGroupLayout(WebGPUBindGroupLayoutDescriptor descriptor); > // WebGPUPipelineLayout createPipelineLayout(WebGPUPipelineLayoutDescriptor descriptor); > // WebGPUBindGroup createBindGroup(WebGPUBindGroupDescriptor descriptor); > // >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 7352f33e176dc9abb86f5884562c82f5b76c7bfa..9deaf4c2d883a46463f9c34117b2b3ca5a60ab46 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -303,6 +303,7 @@ Modules/websockets/WorkerThreadableWebSocketChannel.cpp > Modules/webgpu/DOMWindowWebGPU.cpp > Modules/webgpu/WebGPU.cpp > Modules/webgpu/WebGPUAdapter.cpp >+Modules/webgpu/WebGPUBindGroupLayout.cpp > Modules/webgpu/WebGPUBuffer.cpp > Modules/webgpu/WebGPUCommandBuffer.cpp > Modules/webgpu/WebGPUDevice.cpp >@@ -1739,6 +1740,7 @@ platform/graphics/filters/SourceAlpha.cpp > platform/graphics/filters/SourceGraphic.cpp > platform/graphics/filters/SpotLightSource.cpp > >+platform/graphics/gpu/GPUBindGroupLayout.cpp > platform/graphics/gpu/GPUDevice.cpp > platform/graphics/gpu/legacy/GPULegacyBuffer.cpp > platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp >@@ -3222,6 +3224,7 @@ JSWebAnimation.cpp > JSWebGPU.cpp > JSWebGPUAdapter.cpp > JSWebGPUAdapterDescriptor.cpp >+JSWebGPUBindGroupLayout.cpp > JSWebGPUBindGroupLayoutBinding.cpp > JSWebGPUBindGroupLayoutDescriptor.cpp > JSWebGPUBuffer.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index c924a495727b4de5bd289fc18ce7c821575239fa..583376bca1307a1f2394b8cf35f41dd8233983cf 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -13713,6 +13713,9 @@ > D001D9AD21B0C81A0023B9BC /* WebGPUColor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUColor.idl; sourceTree = "<group>"; }; > D001D9B021B0C8A80023B9BC /* WebGPURenderPassColorAttachmentDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPURenderPassColorAttachmentDescriptor.h; sourceTree = "<group>"; }; > D001D9B121B0C8A80023B9BC /* WebGPURenderPassColorAttachmentDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPURenderPassColorAttachmentDescriptor.idl; sourceTree = "<group>"; }; >+ D003287921C8645B00622AA6 /* WebGPUBindGroupLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUBindGroupLayout.h; sourceTree = "<group>"; }; >+ D003287A21C8645B00622AA6 /* WebGPUBindGroupLayout.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUBindGroupLayout.cpp; sourceTree = "<group>"; }; >+ D003287B21C8645B00622AA6 /* WebGPUBindGroupLayout.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBindGroupLayout.idl; sourceTree = "<group>"; }; > D00F5940216ECC7A000D71DB /* DOMWindowWebGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMWindowWebGPU.h; sourceTree = "<group>"; }; > D00F5941216ECC7A000D71DB /* DOMWindowWebGPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowWebGPU.cpp; sourceTree = "<group>"; }; > D00F5942216ECC7A000D71DB /* DOMWindowWebGPU.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMWindowWebGPU.idl; sourceTree = "<group>"; }; >@@ -13727,6 +13730,8 @@ > D00F595421701D8C000D71DB /* WebGPUDevice.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUDevice.idl; sourceTree = "<group>"; }; > D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; }; > D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; }; >+ D02454D021C4A41C00B73628 /* GPUBindGroupLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBindGroupLayout.h; sourceTree = "<group>"; }; >+ D02454D121C4A41C00B73628 /* GPUBindGroupLayout.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUBindGroupLayout.cpp; sourceTree = "<group>"; }; > D02B83ED21C8397A00F85473 /* WebGPUBindGroupLayoutDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBindGroupLayoutDescriptor.idl; sourceTree = "<group>"; }; > D02C26912181416D00D818E4 /* WebGPUAdapterDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUAdapterDescriptor.h; sourceTree = "<group>"; }; > D02C26922181416D00D818E4 /* WebGPUAdapterDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUAdapterDescriptor.idl; sourceTree = "<group>"; }; >@@ -18047,6 +18052,8 @@ > children = ( > D087CE3721ACA94200BDE174 /* cocoa */, > 312FF8CE21A4C33F00EB199D /* legacy */, >+ D02454D121C4A41C00B73628 /* GPUBindGroupLayout.cpp */, >+ D02454D021C4A41C00B73628 /* GPUBindGroupLayout.h */, > D0B8BB0121C46E78000C7681 /* GPUBindGroupLayoutBinding.h */, > D083D98421C48050008E8EFF /* GPUBindGroupLayoutDescriptor.h */, > D0D8649221B760F2003C983C /* GPUBuffer.h */, >@@ -25556,6 +25563,9 @@ > D00F5951216FFAC2000D71DB /* WebGPUAdapter.idl */, > D02C26912181416D00D818E4 /* WebGPUAdapterDescriptor.h */, > D02C26922181416D00D818E4 /* WebGPUAdapterDescriptor.idl */, >+ D003287A21C8645B00622AA6 /* WebGPUBindGroupLayout.cpp */, >+ D003287921C8645B00622AA6 /* WebGPUBindGroupLayout.h */, >+ D003287B21C8645B00622AA6 /* WebGPUBindGroupLayout.idl */, > D0B8BB0521C47256000C7681 /* WebGPUBindGroupLayoutBinding.h */, > D0B8BB0621C47256000C7681 /* WebGPUBindGroupLayoutBinding.idl */, > D083D98621C4813E008E8EFF /* WebGPUBindGroupLayoutDescriptor.h */, >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index 6d1c518b31e8f2252fb13cf9c3c66bc629d2945e..8f278c63f6d6e8690e82d3c3453cb5b4157ba860 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -189,6 +189,7 @@ namespace WebCore { > macro(WebGLVertexArrayObject) \ > macro(WebGPU) \ > macro(WebGPUAdapter) \ >+ macro(WebGPUBindGroupLayout) \ > macro(WebGPUBuffer) \ > macro(WebGPUBufferUsage) \ > macro(WebGPUCommandBuffer) \ >diff --git a/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..03262d83d6259423165671e662f4e259783867a9 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp >@@ -0,0 +1,46 @@ >+/* >+ * 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) >+ >+namespace WebCore { >+ >+Ref<GPUBindGroupLayout> GPUBindGroupLayout::create(GPUBindGroupLayoutDescriptor&& descriptor) >+{ >+ return adoptRef(*new GPUBindGroupLayout(WTFMove(descriptor))); >+} >+ >+GPUBindGroupLayout::GPUBindGroupLayout(GPUBindGroupLayoutDescriptor&& descriptor) >+ : m_descriptor(WTFMove(descriptor)) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >+ >diff --git a/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h >new file mode 100644 >index 0000000000000000000000000000000000000000..5806a95a2f4d376ed7de27ea0ad5059b32470702 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h >@@ -0,0 +1,49 @@ >+/* >+ * 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. >+ */ >+ >+#pragma once >+ >+#if ENABLE(WEBGPU) >+ >+#include "GPUBindGroupLayoutDescriptor.h" >+ >+#include <wtf/Ref.h> >+#include <wtf/RefCounted.h> >+ >+namespace WebCore { >+ >+class GPUBindGroupLayout : public RefCounted<GPUBindGroupLayout> { >+public: >+ static Ref<GPUBindGroupLayout> create(GPUBindGroupLayoutDescriptor&&); >+ >+private: >+ GPUBindGroupLayout(GPUBindGroupLayoutDescriptor&&); >+ >+ GPUBindGroupLayoutDescriptor m_descriptor; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp b/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp >index b5b49193b1df823d073157301defae63b8227150..c69815c7a5774aade2ed7bccea893eab6f89ff37 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp >+++ b/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp >@@ -28,6 +28,8 @@ > > #if ENABLE(WEBGPU) > >+#include "GPUBindGroupLayout.h" >+#include "GPUBindGroupLayoutDescriptor.h" > #include "GPUBuffer.h" > #include "GPUBufferDescriptor.h" > #include "GPURenderPipeline.h" >@@ -42,6 +44,11 @@ RefPtr<GPUBuffer> GPUDevice::createBuffer(GPUBufferDescriptor&& descriptor) cons > return GPUBuffer::create(*this, WTFMove(descriptor)); > } > >+Ref<GPUBindGroupLayout> GPUDevice::createBindGroupLayout(GPUBindGroupLayoutDescriptor&& descriptor) const >+{ >+ return GPUBindGroupLayout::create(WTFMove(descriptor)); >+} >+ > RefPtr<GPUShaderModule> GPUDevice::createShaderModule(GPUShaderModuleDescriptor&& descriptor) const > { > return GPUShaderModule::create(*this, WTFMove(descriptor)); >diff --git a/Source/WebCore/platform/graphics/gpu/GPUDevice.h b/Source/WebCore/platform/graphics/gpu/GPUDevice.h >index 356af152a1ccb0766c1d54da640bcc7b3235ad73..b02987e2117f6f51babc28bdf13a6df05eb4525d 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUDevice.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUDevice.h >@@ -41,10 +41,12 @@ namespace WebCore { > using PlatformDevice = MTLDevice; > using PlatformDeviceSmartPtr = RetainPtr<MTLDevice>; > >+class GPUBindGroupLayout; > class GPUBuffer; > class GPURenderPipeline; > class GPUShaderModule; > >+struct GPUBindGroupLayoutDescriptor; > struct GPUBufferDescriptor; > struct GPUShaderModuleDescriptor; > struct GPURenderPipelineDescriptor; >@@ -55,6 +57,8 @@ public: > > RefPtr<GPUBuffer> createBuffer(GPUBufferDescriptor&&) const; > >+ Ref<GPUBindGroupLayout> createBindGroupLayout(GPUBindGroupLayoutDescriptor&&) const; >+ > RefPtr<GPUShaderModule> createShaderModule(GPUShaderModuleDescriptor&&) const; > RefPtr<GPURenderPipeline> createRenderPipeline(GPURenderPipelineDescriptor&&) const; > >diff --git a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h b/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h >index b4a81ae44cf5e9bf68c0d9708d9d0f9c91562e46..73f4d67bd7baa224df64f4da140f24e64274086e 100644 >--- a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h >+++ b/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h >@@ -31,6 +31,7 @@ > #include <wtf/Lock.h> > #include <wtf/RetainPtr.h> > #include <wtf/ThreadSafeRefCounted.h> >+#include <wtf/WeakPtr.h> > #include <wtf/threads/BinarySemaphore.h> > > typedef struct opaqueCMSampleBuffer *CMSampleBufferRef; >diff --git a/Source/WebCore/platform/sql/SQLiteFileSystem.h b/Source/WebCore/platform/sql/SQLiteFileSystem.h >index 17bfa0628790bb981294093eea5a0c0b386b894a..5f4b49d5a501647b47c7dd0259dee179379de668 100644 >--- a/Source/WebCore/platform/sql/SQLiteFileSystem.h >+++ b/Source/WebCore/platform/sql/SQLiteFileSystem.h >@@ -31,6 +31,7 @@ > #ifndef SQLiteFileSystem_h > #define SQLiteFileSystem_h > >+#include <wtf/WallTime.h> > #include <wtf/text/WTFString.h> > > struct sqlite3; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 09e1a8e49e3865ad4da37f61c816f4ec78422769..fba5c2343d0aa86654dfb594c92f87ba66f7432f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-12-18 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] BindGroupLayout and Device::createBindGroupLayout >+ https://bugs.webkit.org/show_bug.cgi?id=192817 >+ >+ Reviewed by Dean Jackson. >+ >+ Update bind-group-layouts to test new functionality. >+ >+ * webgpu/bind-group-layouts-expected.txt: >+ * webgpu/bind-group-layouts.html: >+ > 2018-12-17 Justin Fan <justin_fan@apple.com> > > [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries >diff --git a/LayoutTests/webgpu/bind-group-layouts-expected.txt b/LayoutTests/webgpu/bind-group-layouts-expected.txt >index b591f518a5aa83998e80402bc93ce761e8c9bf59..f143ee6ba86210b5aa538282df2a2dcaad7c89b0 100644 >--- a/LayoutTests/webgpu/bind-group-layouts-expected.txt >+++ b/LayoutTests/webgpu/bind-group-layouts-expected.txt >@@ -1,3 +1,4 @@ > >-PASS Create WebGPUBindGroupLayoutDescriptor. >+PASS Create a basic WebGPUBindGroupLayoutDescriptor. >+PASS Create a basic WebGPUBindGroupLayout with a WebGPUDevice. > >diff --git a/LayoutTests/webgpu/bind-group-layouts.html b/LayoutTests/webgpu/bind-group-layouts.html >index 3191b20e067d5edee771c800350eef288026223e..06b1eb57a79b602f11d4b8905fe74799464ac4a8 100644 >--- a/LayoutTests/webgpu/bind-group-layouts.html >+++ b/LayoutTests/webgpu/bind-group-layouts.html >@@ -1,7 +1,8 @@ > <!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] --> > <meta charset=utf-8> >-<title>Create WebGPUBindGroupLayoutDescriptor.</title> >+<title>Create WebGPUBindGroupLayout.</title> > <body> >+<script src="js/webgpu-functions.js"></script> > <script src="../resources/testharness.js"></script> > <script src="../resources/testharnessreport.js"></script> > <script> >@@ -14,12 +15,16 @@ function createBindGroupLayoutBinding() { > } > > test(() => { >- const bindGroupLayoutBinding = createBindGroupLayoutBinding(); >- const bindGroupLayoutDescriptor = { bindings: [bindGroupLayoutBinding] }; >+ const bindGroupLayoutDescriptor = { bindings: [createBindGroupLayoutBinding()] }; > assert_not_equals(bindGroupLayoutDescriptor.bindings[0].visibility & WebGPUShaderStageBit.FRAGMENT, 0); > assert_not_equals(bindGroupLayoutDescriptor.bindings[0].visibility & WebGPUShaderStageBit.VERTEX, 0); > assert_equals(bindGroupLayoutDescriptor.bindings[0].type, "storageBuffer"); >-}); >+}, "Create a basic WebGPUBindGroupLayoutDescriptor."); > >+promise_test(async () => { >+ const device = await window.getBasicDevice(); >+ const bindGroupLayout = device.createBindGroupLayout({ bindings: [createBindGroupLayoutBinding()] }); >+ assert_true(bindGroupLayout instanceof WebGPUBindGroupLayout, "createBindGroupLayout returned a WebGPUBindGroupLayout"); >+}, "Create a basic WebGPUBindGroupLayout with a WebGPUDevice."); > </script> > </body> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192817
:
357597
| 357600