WebKit Bugzilla
Attachment 357367 Details for
Bug 192726
: [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-192726-20181214180620.patch (text/plain), 30.50 KB, created by
Justin Fan
on 2018-12-14 18:06:21 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Justin Fan
Created:
2018-12-14 18:06:21 PST
Size:
30.50 KB
patch
obsolete
>Subversion Revision: 239235 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2ec8741f5c7f638a91c877d25770acd7ccc8d4d9..1293d32d3b231627048e0ce363d25fb39e998d9b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,33 @@ >+2018-12-14 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries >+ https://bugs.webkit.org/show_bug.cgi?id=192726 >+ >+ Reviewed by Myles C. Maxfield. >+ >+ Test: webgpu/bind-group-layouts.html >+ >+ Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs: >+ * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added. >+ * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added. >+ * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added. >+ * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added. >+ * Modules/webgpu/WebGPUShaderStageBit.h: Added. >+ * Modules/webgpu/WebGPUShaderStageBit.idl: Added. >+ * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added. >+ * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added. >+ >+ Add the new symbols and files to the project: >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/WebCoreBuiltinNames.h: >+ >+ Small FIXME update for later: >+ * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: >+ (WebCore::GPURenderPassEncoder::setVertexBuffers): >+ > 2018-12-14 David Kilzer <ddkilzer@apple.com> > > clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/ >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 0bdd29cde1808c25d5ce8a165455584786066fba..df7da0f84546b441a7302587fb7dac4e7b4a6b6f 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -458,6 +458,8 @@ set(WebCore_NON_SVG_IDL_FILES > Modules/webgpu/WebGPU.idl > Modules/webgpu/WebGPUAdapter.idl > Modules/webgpu/WebGPUAdapterDescriptor.idl >+ Modules/webgpu/WebGPUBindGroupLayoutBinding.idl >+ Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl > Modules/webgpu/WebGPUBuffer.idl > Modules/webgpu/WebGPUBufferDescriptor.idl > Modules/webgpu/WebGPUBufferUsage.idl >@@ -479,6 +481,7 @@ set(WebCore_NON_SVG_IDL_FILES > Modules/webgpu/WebGPURenderingContext.idl > Modules/webgpu/WebGPUShaderModule.idl > Modules/webgpu/WebGPUShaderModuleDescriptor.idl >+ Modules/webgpu/WebGPUShaderStageBit.idl > Modules/webgpu/WebGPUSwapChain.idl > Modules/webgpu/WebGPUTexture.idl > Modules/webgpu/WebGPUTextureFormatEnum.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index f6f7e3516ae7465882cfbf30512754d9434637e6..321bd439a5e085f22900ee7268e7da09bb2bed27 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -375,6 +375,8 @@ JS_BINDING_IDLS = \ > $(WebCore)/Modules/webgpu/WebGPU.idl \ > $(WebCore)/Modules/webgpu/WebGPUAdapter.idl \ > $(WebCore)/Modules/webgpu/WebGPUAdapterDescriptor.idl \ >+ $(WebCore)/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl \ >+ $(WebCore)/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl \ > $(WebCore)/Modules/webgpu/WebGPUBuffer.idl \ > $(WebCore)/Modules/webgpu/WebGPUBufferDescriptor.idl \ > $(WebCore)/Modules/webgpu/WebGPUBufferUsage.idl \ >@@ -396,6 +398,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/Modules/webgpu/WebGPURenderingContext.idl \ > $(WebCore)/Modules/webgpu/WebGPUShaderModule.idl \ > $(WebCore)/Modules/webgpu/WebGPUShaderModuleDescriptor.idl \ >+ $(WebCore)/Modules/webgpu/WebGPUShaderStageBit.idl \ > $(WebCore)/Modules/webgpu/WebGPUSwapChain.idl \ > $(WebCore)/Modules/webgpu/WebGPUTexture.idl \ > $(WebCore)/Modules/webgpu/WebGPUTextureFormatEnum.idl \ >diff --git a/Source/WebCore/Modules/streams/WebGPUBindGroupLayoutDescriptor.h b/Source/WebCore/Modules/streams/WebGPUBindGroupLayoutDescriptor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..a26fbfa623ec1ca303898b87f013802a1ddd7cff >--- /dev/null >+++ b/Source/WebCore/Modules/streams/WebGPUBindGroupLayoutDescriptor.h >@@ -0,0 +1,38 @@ >+/* >+ * 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" >+ >+namespace WebCore { >+ >+using WebGPUBindGroupLayoutDescriptor = GPUBindGroupLayoutDescriptor; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/streams/WebGPUBindGroupLayoutDescriptor.idl b/Source/WebCore/Modules/streams/WebGPUBindGroupLayoutDescriptor.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..bc89ab9f668a528cc0c35a3d9c0839ef0547e44c >--- /dev/null >+++ b/Source/WebCore/Modules/streams/WebGPUBindGroupLayoutDescriptor.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 >+] dictionary WebGPUBindGroupLayoutDescriptor { >+ sequence<WebGPUBindGroupLayoutBinding> bindings; >+}; >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.h b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.h >new file mode 100644 >index 0000000000000000000000000000000000000000..a4baf4cb9f567abbf70abba2208b253bf16afd02 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.h >@@ -0,0 +1,40 @@ >+/* >+ * 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 "GPUBindGroupLayoutBinding.h" >+ >+namespace WebCore { >+ >+using WebGPUBindGroupLayoutBinding = GPUBindGroupLayoutBinding; >+using WebGPUBindingType = GPUBindGroupLayoutBinding::BindingType; >+using WebGPUShaderStageFlags = GPUShaderStageFlags; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..65bf05b2d40fd898c4a006ab3397002dadd25bb7 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl >@@ -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. >+ */ >+// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl >+ >+typedef unsigned long u32; >+typedef u32 WebGPUShaderStageFlags; >+ >+[ >+ Conditional=WEBGPU, >+ EnabledAtRuntime=WebGPU >+] enum WebGPUBindingType { >+ "uniformBuffer", >+ "sampler", >+ "sampledTexture", >+ "storageBuffer" >+ // TODO other binding types >+}; >+ >+[ >+ Conditional=WEBGPU, >+ EnabledAtRuntime=WebGPU >+] dictionary WebGPUBindGroupLayoutBinding { >+ u32 binding; >+ WebGPUShaderStageFlags visibility; >+ WebGPUBindingType type; >+}; >+ >diff --git a/Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h b/Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h >new file mode 100644 >index 0000000000000000000000000000000000000000..841320af90e579ffbfc7945994c36680e240415c >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h >@@ -0,0 +1,38 @@ >+/* >+ * 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 "GPUBindGroupLayoutBinding.h" >+ >+namespace WebCore { >+ >+using WebGPUShaderStageBit = GPUShaderStageBit; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl b/Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..9eea7a4885edcc4e9e321e031a6fd8dcfac25de2 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl >@@ -0,0 +1,38 @@ >+/* >+ * 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 >+ >+typedef unsigned long u32; >+ >+[ >+ Conditional=WEBGPU, >+ EnabledAtRuntime=WebGPU, >+ ImplementationLacksVTable >+] interface WebGPUShaderStageBit { >+ const u32 NONE = 0; >+ const u32 VERTEX = 1; >+ const u32 FRAGMENT = 2; >+ const u32 COMPUTE = 4; >+}; >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index b4bdb25b5170687440ba663f06a09bec401e0e2f..7352f33e176dc9abb86f5884562c82f5b76c7bfa 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -3222,6 +3222,8 @@ JSWebAnimation.cpp > JSWebGPU.cpp > JSWebGPUAdapter.cpp > JSWebGPUAdapterDescriptor.cpp >+JSWebGPUBindGroupLayoutBinding.cpp >+JSWebGPUBindGroupLayoutDescriptor.cpp > JSWebGPUBuffer.cpp > JSWebGPUBufferDescriptor.cpp > JSWebGPUBufferUsage.cpp >@@ -3243,6 +3245,7 @@ JSWebGPURenderPipeline.cpp > JSWebGPURenderPipelineDescriptor.cpp > JSWebGPUShaderModule.cpp > JSWebGPUShaderModuleDescriptor.cpp >+JSWebGPUShaderStageBit.cpp > JSWebGPUSwapChain.cpp > JSWebGPUTexture.cpp > JSWebGPUTextureFormatEnum.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index ea4e41b2e3ada9fa1d1922f3bc3044ba57680a51..328b0d8ef83fade1e25119bfe03ddb02a7fdd300 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -13817,6 +13817,9 @@ > D06C0D8E0CFD11460065F43F /* RemoveFormatCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoveFormatCommand.cpp; sourceTree = "<group>"; }; > D07DEAB70A36554A00CA30F8 /* InsertListCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InsertListCommand.cpp; sourceTree = "<group>"; }; > D07DEAB80A36554A00CA30F8 /* InsertListCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InsertListCommand.h; sourceTree = "<group>"; }; >+ D083D98421C48050008E8EFF /* GPUBindGroupLayoutDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBindGroupLayoutDescriptor.h; sourceTree = "<group>"; }; >+ D083D98621C4813E008E8EFF /* WebGPUBindGroupLayoutDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebGPUBindGroupLayoutDescriptor.h; path = Modules/streams/WebGPUBindGroupLayoutDescriptor.h; sourceTree = SOURCE_ROOT; }; >+ D083D98721C4813E008E8EFF /* WebGPUBindGroupLayoutDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; name = WebGPUBindGroupLayoutDescriptor.idl; path = Modules/streams/WebGPUBindGroupLayoutDescriptor.idl; sourceTree = SOURCE_ROOT; }; > D0843A4A20FEBE3D00FE860E /* GraphicsContext3DManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3DManager.h; sourceTree = "<group>"; }; > D0843A4C20FEC16500FE860E /* GraphicsContext3DManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DManager.cpp; sourceTree = "<group>"; }; > D086FE9609D53AAB005BC74D /* UnlinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkCommand.h; sourceTree = "<group>"; }; >@@ -13838,6 +13841,11 @@ > D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderOptions.h; sourceTree = "<group>"; }; > D0B0556609C6700100307E43 /* CreateLinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateLinkCommand.h; sourceTree = "<group>"; }; > D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CreateLinkCommand.cpp; sourceTree = "<group>"; }; >+ D0B8BB0121C46E78000C7681 /* GPUBindGroupLayoutBinding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBindGroupLayoutBinding.h; sourceTree = "<group>"; }; >+ D0B8BB0321C4711D000C7681 /* WebGPUShaderStageBit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUShaderStageBit.h; sourceTree = "<group>"; }; >+ D0B8BB0421C4711D000C7681 /* WebGPUShaderStageBit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUShaderStageBit.idl; sourceTree = "<group>"; }; >+ D0B8BB0521C47256000C7681 /* WebGPUBindGroupLayoutBinding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUBindGroupLayoutBinding.h; sourceTree = "<group>"; }; >+ D0B8BB0621C47256000C7681 /* WebGPUBindGroupLayoutBinding.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBindGroupLayoutBinding.idl; sourceTree = "<group>"; }; > D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedStyleSheetClient.h; sourceTree = "<group>"; }; > D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommandIOS.cpp; sourceTree = "<group>"; }; > D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationCommandIOS.h; sourceTree = "<group>"; }; >@@ -18039,6 +18047,8 @@ > children = ( > D087CE3721ACA94200BDE174 /* cocoa */, > 312FF8CE21A4C33F00EB199D /* legacy */, >+ D0B8BB0121C46E78000C7681 /* GPUBindGroupLayoutBinding.h */, >+ D083D98421C48050008E8EFF /* GPUBindGroupLayoutDescriptor.h */, > D0D8649221B760F2003C983C /* GPUBuffer.h */, > D0D8648721B64CAA003C983C /* GPUBufferDescriptor.h */, > D001D9AB21B0C7BF0023B9BC /* GPUColor.h */, >@@ -25546,6 +25556,10 @@ > D00F5951216FFAC2000D71DB /* WebGPUAdapter.idl */, > D02C26912181416D00D818E4 /* WebGPUAdapterDescriptor.h */, > D02C26922181416D00D818E4 /* WebGPUAdapterDescriptor.idl */, >+ D0B8BB0521C47256000C7681 /* WebGPUBindGroupLayoutBinding.h */, >+ D0B8BB0621C47256000C7681 /* WebGPUBindGroupLayoutBinding.idl */, >+ D083D98621C4813E008E8EFF /* WebGPUBindGroupLayoutDescriptor.h */, >+ D083D98721C4813E008E8EFF /* WebGPUBindGroupLayoutDescriptor.idl */, > D0D8648D21B70676003C983C /* WebGPUBuffer.cpp */, > D0D8648C21B70676003C983C /* WebGPUBuffer.h */, > D0D8648E21B70676003C983C /* WebGPUBuffer.idl */, >@@ -25597,6 +25611,8 @@ > D0615FCE217FE5C6008A48A8 /* WebGPUShaderModule.idl */, > D060D8872182697000339318 /* WebGPUShaderModuleDescriptor.h */, > D060D88421825D5F00339318 /* WebGPUShaderModuleDescriptor.idl */, >+ D0B8BB0321C4711D000C7681 /* WebGPUShaderStageBit.h */, >+ D0B8BB0421C4711D000C7681 /* WebGPUShaderStageBit.idl */, > D0DA0BE5217930E2007FE2AC /* WebGPUSwapChain.cpp */, > D0DA0BE4217930E2007FE2AC /* WebGPUSwapChain.h */, > D0DA0BE6217930E2007FE2AC /* WebGPUSwapChain.idl */, >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index e0b397f3ddd643e7e4e13fc9853e5e01d1b1fcf1..6d1c518b31e8f2252fb13cf9c3c66bc629d2945e 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -201,6 +201,7 @@ namespace WebCore { > macro(WebGPURenderPassEncoder) \ > macro(WebGPURenderPipeline) \ > macro(WebGPUShaderModule) \ >+ macro(WebGPUShaderStageBit) \ > macro(WebGPUSwapChain) \ > macro(WebGPUTexture) \ > macro(WebGPUTextureView) \ >diff --git a/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h >new file mode 100644 >index 0000000000000000000000000000000000000000..ae10d9bd48345e8b95126d35b30fe33c72166e6c >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h >@@ -0,0 +1,59 @@ >+/* >+ * 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 <wtf/RefCounted.h> >+ >+namespace WebCore { >+ >+using GPUShaderStageFlags = unsigned long; >+ >+class GPUShaderStageBit : public RefCounted<GPUShaderStageBit> { >+public: >+ static const GPUShaderStageFlags NONE = 0; >+ static const GPUShaderStageFlags VERTEX = 1; >+ static const GPUShaderStageFlags FRAGMENT = 2; >+ static const GPUShaderStageFlags COMPUTE = 4; >+}; >+ >+struct GPUBindGroupLayoutBinding { >+ enum class BindingType { >+ UniformBuffer, >+ Sampler, >+ SampledTexture, >+ StorageBuffer >+ }; >+ >+ unsigned long binding; >+ GPUShaderStageFlags visibility; >+ BindingType type; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..b3476455c448439a2d5f0a159b968de97656870b >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h >@@ -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. >+ */ >+ >+#pragma once >+ >+#if ENABLE(WEBGPU) >+ >+#include "GPUBindGroupLayoutBinding.h" >+ >+#include <wtf/Vector.h> >+ >+namespace WebCore { >+ >+struct GPUBindGroupLayoutDescriptor { >+ Vector<GPUBindGroupLayoutBinding> bindings; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >+ >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm >index 5a73bee5bd5b09d79b15d68a0683f5872f4d2dc1..5565063f6400b403854353daac67e35051401473 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm >@@ -88,6 +88,7 @@ void GPURenderPassEncoder::setVertexBuffers(unsigned long index, Vector<Ref<cons > { > ASSERT(buffers.size() && offsets.size() == buffers.size()); > // FIXME: Only worry about the first buffer for now, and treat startSlot as the index. >+ // FIXME: Replace with MTLRenderPassEncoder::setVertexBuffers. > [m_platformRenderPassEncoder setVertexBuffer:buffers[0]->platformBuffer() offset:offsets[0] atIndex:index]; > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8642cbfca317aa207b825ec1f75912645f8559a6..ce31061c3023e85dc3979c0acff8f0b28c205035 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-12-14 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries >+ https://bugs.webkit.org/show_bug.cgi?id=192726 >+ >+ Reviewed by Myles C. Maxfield. >+ >+ Add simple test to ensure a WebGPUBindGroupLayoutDescriptor can be created. >+ >+ * webgpu/bind-group-layouts-expected.txt: Added. >+ * webgpu/bind-group-layouts.html: Added. >+ > 2018-12-14 Matt Baker <mattbaker@apple.com> > > Web Inspector: Cookies view should use model objects instead of raw payload data >diff --git a/LayoutTests/webgpu/bind-group-layouts-expected.txt b/LayoutTests/webgpu/bind-group-layouts-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b591f518a5aa83998e80402bc93ce761e8c9bf59 >--- /dev/null >+++ b/LayoutTests/webgpu/bind-group-layouts-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Create WebGPUBindGroupLayoutDescriptor. >+ >diff --git a/LayoutTests/webgpu/bind-group-layouts.html b/LayoutTests/webgpu/bind-group-layouts.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3191b20e067d5edee771c800350eef288026223e >--- /dev/null >+++ b/LayoutTests/webgpu/bind-group-layouts.html >@@ -0,0 +1,25 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] --> >+<meta charset=utf-8> >+<title>Create WebGPUBindGroupLayoutDescriptor.</title> >+<body> >+<script src="../resources/testharness.js"></script> >+<script src="../resources/testharnessreport.js"></script> >+<script> >+function createBindGroupLayoutBinding() { >+ return { >+ binding: 0, >+ visibility: WebGPUShaderStageBit.FRAGMENT | WebGPUShaderStageBit.VERTEX, >+ type: "storageBuffer" >+ }; >+} >+ >+test(() => { >+ const bindGroupLayoutBinding = createBindGroupLayoutBinding(); >+ const bindGroupLayoutDescriptor = { bindings: [bindGroupLayoutBinding] }; >+ 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"); >+}); >+ >+</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 192726
:
357358
|
357364
|
357367
|
357371
|
357453
|
357463
|
357465