WebKit Bugzilla
Attachment 357652 Details for
Bug 192843
: [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192843-20181218214040.patch (text/plain), 39.81 KB, created by
Justin Fan
on 2018-12-18 21:40:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Fan
Created:
2018-12-18 21:40:40 PST
Size:
39.81 KB
patch
obsolete
>Subversion Revision: 239355 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fefaecdbeac9e870174436f23e01ddf734806122..f0535f368b1436588544351f1b2ddccaac97fb6b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,44 @@ >+2018-12-18 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] WebGPUPipelineLayout/Descriptor and device::createPipelineLayout >+ https://bugs.webkit.org/show_bug.cgi?id=192843 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: webgpu/pipeline-layouts.html >+ >+ Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout: >+ * Modules/webgpu/WebGPUBindGroupLayout.cpp: >+ (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout): >+ * Modules/webgpu/WebGPUBindGroupLayout.h: >+ (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter. >+ * Modules/webgpu/WebGPUDevice.cpp: >+ (WebCore::WebGPUDevice::createPipelineLayout const): Added. >+ * Modules/webgpu/WebGPUDevice.h: >+ * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout. >+ * Modules/webgpu/WebGPUPipelineLayout.cpp: Added. >+ (WebCore::WebGPUPipelineLayout::create): >+ (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout): >+ * Modules/webgpu/WebGPUPipelineLayout.h: Added. >+ * Modules/webgpu/WebGPUPipelineLayout.idl: Added. >+ * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added. >+ * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added. >+ * platform/graphics/gpu/GPUDevice.cpp: >+ (WebCore::GPUDevice::createPipelineLayout const): Added. >+ * platform/graphics/gpu/GPUDevice.h: >+ * platform/graphics/gpu/GPUPipelineLayout.cpp: Added. >+ (WebCore::GPUPipelineLayout::create): >+ (WebCore::GPUPipelineLayout::GPUPipelineLayout): >+ * platform/graphics/gpu/GPUPipelineLayout.h: Added. >+ * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added. >+ >+ Add files and symbols to project: >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/WebCoreBuiltinNames.h: >+ > 2018-12-18 Ryosuke Niwa <rniwa@webkit.org> > > Some iOS app crash in FrameLoader::checkCompleted >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 07cde2374a89c66dcff1f42d64ced5a88dc82191..85b2b53091dbd43eef12588927729de694d1e721 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -471,6 +471,8 @@ set(WebCore_NON_SVG_IDL_FILES > Modules/webgpu/WebGPUInputStateDescriptor.idl > Modules/webgpu/WebGPUInputStepMode.idl > Modules/webgpu/WebGPUPipelineDescriptorBase.idl >+ Modules/webgpu/WebGPUPipelineLayout.idl >+ Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl > Modules/webgpu/WebGPUPipelineStageDescriptor.idl > Modules/webgpu/WebGPUProgrammablePassEncoder.idl > Modules/webgpu/WebGPUQueue.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 0f297ba74b1e4d5eea0b75fe5d409e19d8872c71..e948b702f37a566e550a5ebe56e602fcb7922f8f 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -389,6 +389,8 @@ JS_BINDING_IDLS = \ > $(WebCore)/Modules/webgpu/WebGPUInputStepMode.idl \ > $(WebCore)/Modules/webgpu/WebGPUQueue.idl \ > $(WebCore)/Modules/webgpu/WebGPUPipelineDescriptorBase.idl \ >+ $(WebCore)/Modules/webgpu/WebGPUPipelineLayout.idl \ >+ $(WebCore)/Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl \ > $(WebCore)/Modules/webgpu/WebGPUPipelineStageDescriptor.idl \ > $(WebCore)/Modules/webgpu/WebGPUProgrammablePassEncoder.idl \ > $(WebCore)/Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.idl \ >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp >index e152b7381c08c9523de10b781b03675d03de7b63..d987bf33267844ed5075e83e265f6c2b64dfabef 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp >@@ -36,7 +36,7 @@ Ref<WebGPUBindGroupLayout> WebGPUBindGroupLayout::create(Ref<GPUBindGroupLayout> > } > > WebGPUBindGroupLayout::WebGPUBindGroupLayout(Ref<GPUBindGroupLayout>&& layout) >- : m_layout(WTFMove(layout)) >+ : m_bindGroupLayout(WTFMove(layout)) > { > } > >diff --git a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h >index 7d71e0748957b96bd7da0ca23ba977948c38fd86..be29203a3ee2458a6f9cb477849e21b48e3791bc 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h >@@ -29,8 +29,8 @@ > > #include "GPUBindGroupLayout.h" > >-#include <wtf/Ref.h> > #include <wtf/RefCounted.h> >+#include <wtf/RefPtr.h> > > namespace WebCore { > >@@ -38,10 +38,12 @@ class WebGPUBindGroupLayout : public RefCounted<WebGPUBindGroupLayout> { > public: > static Ref<WebGPUBindGroupLayout> create(Ref<GPUBindGroupLayout>&&); > >+ RefPtr<GPUBindGroupLayout> bindGroupLayout() const { return m_bindGroupLayout.copyRef(); } >+ > private: > explicit WebGPUBindGroupLayout(Ref<GPUBindGroupLayout>&&); > >- Ref<GPUBindGroupLayout> m_layout; >+ Ref<GPUBindGroupLayout> m_bindGroupLayout; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >index e78451dd56b069b48b23e8b6d2fe6d3f52c91118..a3fc7ea138f9f424aa2f1660c35433c529bfaf37 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >@@ -36,6 +36,8 @@ > #include "WebGPUBindGroupLayout.h" > #include "WebGPUBuffer.h" > #include "WebGPUCommandBuffer.h" >+#include "WebGPUPipelineLayout.h" >+#include "WebGPUPipelineLayoutDescriptor.h" > #include "WebGPUPipelineStageDescriptor.h" > #include "WebGPUQueue.h" > #include "WebGPURenderPipeline.h" >@@ -71,6 +73,16 @@ Ref<WebGPUBindGroupLayout> WebGPUDevice::createBindGroupLayout(WebGPUBindGroupLa > return WebGPUBindGroupLayout::create(WTFMove(layout)); > } > >+Ref<WebGPUPipelineLayout> WebGPUDevice::createPipelineLayout(WebGPUPipelineLayoutDescriptor&& descriptor) const >+{ >+ // FIXME: Is an empty pipelineLayout an error? >+ auto bindGroupLayouts = descriptor.bindGroupLayouts.map([] (const auto& layout) -> RefPtr<const GPUBindGroupLayout> { >+ return layout->bindGroupLayout(); >+ }); >+ auto layout = m_device->createPipelineLayout(GPUPipelineLayoutDescriptor { WTFMove(bindGroupLayouts) }); >+ return WebGPUPipelineLayout::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 30b2e8627d03a13559c54e427e3f22365f5a23da..44cce05ba5ce4c83ad59e444f6b6dad66d0c3b3e 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.h >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.h >@@ -43,9 +43,11 @@ class ScriptExecutionContext; > class WebGPUBindGroupLayout; > class WebGPUBuffer; > class WebGPUCommandBuffer; >+class WebGPUPipelineLayout; > class WebGPURenderPipeline; > class WebGPUShaderModule; > >+struct WebGPUPipelineLayoutDescriptor; > struct WebGPURenderPipelineDescriptor; > struct WebGPUShaderModuleDescriptor; > >@@ -59,6 +61,7 @@ public: > RefPtr<WebGPUBuffer> createBuffer(WebGPUBufferDescriptor&&) const; > > Ref<WebGPUBindGroupLayout> createBindGroupLayout(WebGPUBindGroupLayoutDescriptor&&) const; >+ Ref<WebGPUPipelineLayout> createPipelineLayout(WebGPUPipelineLayoutDescriptor&&) 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 8348dfbdca7b171a65c852a26add83ebe1ced17c..7607d92e949a4be1eeb935cdda051d7b861061ea 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.idl >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.idl >@@ -36,6 +36,7 @@ > WebGPUBuffer createBuffer(WebGPUBufferDescriptor descriptor); > > WebGPUBindGroupLayout createBindGroupLayout(WebGPUBindGroupLayoutDescriptor descriptor); >+ WebGPUPipelineLayout createPipelineLayout(WebGPUPipelineLayoutDescriptor descriptor); > > WebGPUShaderModule createShaderModule(WebGPUShaderModuleDescriptor descriptor); > WebGPURenderPipeline createRenderPipeline(WebGPURenderPipelineDescriptor descriptor); >@@ -49,7 +50,6 @@ > // WebGPUTexture createTexture(WebGPUTextureDescriptor descriptor); > // WebGPUSampler createSampler(WebGPUSamplerDescriptor descriptor); > // >- // WebGPUPipelineLayout createPipelineLayout(WebGPUPipelineLayoutDescriptor descriptor); > // WebGPUBindGroup createBindGroup(WebGPUBindGroupDescriptor descriptor); > // > // WebGPUBlendState createBlendState(WebGPUBlendStateDescriptor descriptor); >diff --git a/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.cpp b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..c64a54615e6af65d3a898e5d1c99320e200e60b0 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.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 "WebGPUPipelineLayout.h" >+ >+#if ENABLE(WEBGPU) >+ >+namespace WebCore { >+ >+Ref<WebGPUPipelineLayout> WebGPUPipelineLayout::create(Ref<GPUPipelineLayout>&& layout) >+{ >+ return adoptRef(*new WebGPUPipelineLayout(WTFMove(layout))); >+} >+ >+WebGPUPipelineLayout::WebGPUPipelineLayout(Ref<GPUPipelineLayout>&& layout) >+ : m_pipelineLayout(WTFMove(layout)) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.h b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.h >new file mode 100644 >index 0000000000000000000000000000000000000000..555157424b0be29960b4b0acb03ec163ffbc9881 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.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 "GPUPipelineLayout.h" >+ >+#include <wtf/Ref.h> >+#include <wtf/RefCounted.h> >+ >+namespace WebCore { >+ >+class WebGPUPipelineLayout : public RefCounted<WebGPUPipelineLayout> { >+public: >+ static Ref<WebGPUPipelineLayout> create(Ref<GPUPipelineLayout>&&); >+ >+private: >+ explicit WebGPUPipelineLayout(Ref<GPUPipelineLayout>&&); >+ >+ Ref<GPUPipelineLayout> m_pipelineLayout; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.idl b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..c0e856f375d3979f0f732b78be2f8bbce685e7c9 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.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 WebGPUPipelineLayout { >+}; >diff --git a/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.h b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..1b70ac407386ce3ca3167d4c5aade55d2f66da29 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.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 "WebGPUBindGroupLayout.h" >+ >+#include <wtf/RefPtr.h> >+#include <wtf/Vector.h> >+ >+namespace WebCore { >+ >+struct WebGPUPipelineLayoutDescriptor { >+ Vector<RefPtr<WebGPUBindGroupLayout>> bindGroupLayouts; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..e31f88000768ced548d811c4445e8573b0da03b6 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.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 WebGPUPipelineLayoutDescriptor { >+ sequence<WebGPUBindGroupLayout> bindGroupLayouts; >+}; >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index e70db839441c88f160a0f2e6b9e0e9c552d6a7d4..46175f3509502cec11a3a5eee5a9bab4bf8ebf05 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -308,6 +308,7 @@ Modules/webgpu/WebGPUBuffer.cpp > Modules/webgpu/WebGPUCommandBuffer.cpp > Modules/webgpu/WebGPUDevice.cpp > Modules/webgpu/WebGPUQueue.cpp >+Modules/webgpu/WebGPUPipelineLayout.cpp > Modules/webgpu/WebGPUProgrammablePassEncoder.cpp > Modules/webgpu/WebGPURenderingContext.cpp > Modules/webgpu/WebGPURenderPassEncoder.cpp >@@ -1744,6 +1745,7 @@ platform/graphics/filters/SpotLightSource.cpp > > platform/graphics/gpu/GPUBindGroupLayout.cpp > platform/graphics/gpu/GPUDevice.cpp >+platform/graphics/gpu/GPUPipelineLayout.cpp > platform/graphics/gpu/legacy/GPULegacyBuffer.cpp > platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp > platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp >@@ -3241,6 +3243,8 @@ JSWebGPUInputStateDescriptor.cpp > JSWebGPUInputStepMode.cpp > JSWebGPUQueue.cpp > JSWebGPUPipelineDescriptorBase.cpp >+JSWebGPUPipelineLayout.cpp >+JSWebGPUPipelineLayoutDescriptor.cpp > JSWebGPUPipelineStageDescriptor.cpp > JSWebGPUProgrammablePassEncoder.cpp > JSWebGPURenderingContext.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 63e9a683ffa6e1a496c09746f73457f6df1b0485..52919e50634f81ba1dcec7ea0598554719ef7579 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -13720,6 +13720,9 @@ > 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>"; }; >+ D003288421C9A20D00622AA6 /* GPUPipelineLayoutDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPipelineLayoutDescriptor.h; sourceTree = "<group>"; }; >+ D003288621C9A4E500622AA6 /* GPUPipelineLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPipelineLayout.h; sourceTree = "<group>"; }; >+ D003288721C9A4E500622AA6 /* GPUPipelineLayout.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUPipelineLayout.cpp; 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>"; }; >@@ -13808,6 +13811,11 @@ > D045AD2121682474000A6E9B /* WebMetalBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebMetalBuffer.cpp; sourceTree = "<group>"; }; > D045AD2221682474000A6E9B /* WebMetalCommandBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebMetalCommandBuffer.h; sourceTree = "<group>"; }; > D045AD2321682475000A6E9B /* WebMetalCommandQueue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebMetalCommandQueue.cpp; sourceTree = "<group>"; }; >+ D05A99E121C9B50F00032B75 /* WebGPUPipelineLayoutDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUPipelineLayoutDescriptor.h; sourceTree = "<group>"; }; >+ D05A99E221C9B50F00032B75 /* WebGPUPipelineLayoutDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUPipelineLayoutDescriptor.idl; sourceTree = "<group>"; }; >+ D05A99E421C9BF2C00032B75 /* WebGPUPipelineLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUPipelineLayout.h; sourceTree = "<group>"; }; >+ D05A99E521C9BF2C00032B75 /* WebGPUPipelineLayout.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUPipelineLayout.cpp; sourceTree = "<group>"; }; >+ D05A99E621C9BF2C00032B75 /* WebGPUPipelineLayout.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUPipelineLayout.idl; sourceTree = "<group>"; }; > D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; }; > D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; }; > D060D88421825D5F00339318 /* WebGPUShaderModuleDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUShaderModuleDescriptor.idl; sourceTree = "<group>"; }; >@@ -18068,6 +18076,9 @@ > 312FF8BE21A4C2F100EB199D /* GPUDevice.h */, > D0D8649921BA1B1F003C983C /* GPUInputStateDescriptor.h */, > 312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */, >+ D003288721C9A4E500622AA6 /* GPUPipelineLayout.cpp */, >+ D003288621C9A4E500622AA6 /* GPUPipelineLayout.h */, >+ D003288421C9A20D00622AA6 /* GPUPipelineLayoutDescriptor.h */, > 312FF8C221A4C2F300EB199D /* GPUPipelineStageDescriptor.h */, > D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */, > 312FF8C121A4C2F200EB199D /* GPUQueue.h */, >@@ -25600,6 +25611,11 @@ > D063AE4721C06626000E6A35 /* WebGPUInputStepMode.idl */, > D0C419F02183EB31009EC1DE /* WebGPUPipelineDescriptorBase.h */, > D0C419F12183EB31009EC1DE /* WebGPUPipelineDescriptorBase.idl */, >+ D05A99E521C9BF2C00032B75 /* WebGPUPipelineLayout.cpp */, >+ D05A99E421C9BF2C00032B75 /* WebGPUPipelineLayout.h */, >+ D05A99E621C9BF2C00032B75 /* WebGPUPipelineLayout.idl */, >+ D05A99E121C9B50F00032B75 /* WebGPUPipelineLayoutDescriptor.h */, >+ D05A99E221C9B50F00032B75 /* WebGPUPipelineLayoutDescriptor.idl */, > D0C419EB2183CFA2009EC1DE /* WebGPUPipelineStageDescriptor.h */, > D0C419EC2183CFA2009EC1DE /* WebGPUPipelineStageDescriptor.idl */, > D0EACF9221940A5B000FA75C /* WebGPUProgrammablePassEncoder.cpp */, >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index 1d214877cee921f1816efa47da3c0521f000111d..2ae1ecf78361d866821c6e9c83ed5c43bbec456c 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -198,6 +198,7 @@ namespace WebCore { > macro(WebGPUIndexFormat) \ > macro(WebGPUInputStepMode) \ > macro(WebGPUQueue) \ >+ macro(WebGPUPipelineLayout) \ > macro(WebGPUProgrammablePassEncoder) \ > macro(WebGPURenderingContext) \ > macro(WebGPURenderPassEncoder) \ >diff --git a/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp b/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp >index c69815c7a5774aade2ed7bccea893eab6f89ff37..17c76fd3b5e772bc8fb0558bec1383fc90170a65 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp >+++ b/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp >@@ -32,6 +32,8 @@ > #include "GPUBindGroupLayoutDescriptor.h" > #include "GPUBuffer.h" > #include "GPUBufferDescriptor.h" >+#include "GPUPipelineLayout.h" >+#include "GPUPipelineLayoutDescriptor.h" > #include "GPURenderPipeline.h" > #include "GPURenderPipelineDescriptor.h" > #include "GPUShaderModule.h" >@@ -49,6 +51,11 @@ Ref<GPUBindGroupLayout> GPUDevice::createBindGroupLayout(GPUBindGroupLayoutDescr > return GPUBindGroupLayout::create(WTFMove(descriptor)); > } > >+Ref<GPUPipelineLayout> GPUDevice::createPipelineLayout(GPUPipelineLayoutDescriptor&& descriptor) const >+{ >+ return GPUPipelineLayout::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 b02987e2117f6f51babc28bdf13a6df05eb4525d..5c9d309a321c613a78502db9c561ebac50a78ba7 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUDevice.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUDevice.h >@@ -43,13 +43,15 @@ using PlatformDeviceSmartPtr = RetainPtr<MTLDevice>; > > class GPUBindGroupLayout; > class GPUBuffer; >+class GPUPipelineLayout; > class GPURenderPipeline; > class GPUShaderModule; > > struct GPUBindGroupLayoutDescriptor; > struct GPUBufferDescriptor; >-struct GPUShaderModuleDescriptor; >+struct GPUPipelineLayoutDescriptor; > struct GPURenderPipelineDescriptor; >+struct GPUShaderModuleDescriptor; > > class GPUDevice : public RefCounted<GPUDevice> { > public: >@@ -58,6 +60,7 @@ public: > RefPtr<GPUBuffer> createBuffer(GPUBufferDescriptor&&) const; > > Ref<GPUBindGroupLayout> createBindGroupLayout(GPUBindGroupLayoutDescriptor&&) const; >+ Ref<GPUPipelineLayout> createPipelineLayout(GPUPipelineLayoutDescriptor&&) const; > > RefPtr<GPUShaderModule> createShaderModule(GPUShaderModuleDescriptor&&) const; > RefPtr<GPURenderPipeline> createRenderPipeline(GPURenderPipelineDescriptor&&) const; >diff --git a/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.cpp b/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..0331089af3442fc56aa9196c730bcd18f62baaf1 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.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 "GPUPipelineLayout.h" >+ >+#if ENABLE(WEBGPU) >+ >+namespace WebCore { >+ >+Ref<GPUPipelineLayout> GPUPipelineLayout::create(GPUPipelineLayoutDescriptor&& descriptor) >+{ >+ return adoptRef(*new GPUPipelineLayout(WTFMove(descriptor))); >+} >+ >+GPUPipelineLayout::GPUPipelineLayout(GPUPipelineLayoutDescriptor&& descriptor) >+ : m_descriptor(descriptor) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.h b/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0420f74a7b60c3f60af2866ad22cdb46983f5653 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.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 "GPUPipelineLayoutDescriptor.h" >+ >+#include <wtf/Ref.h> >+#include <wtf/RefCounted.h> >+ >+namespace WebCore { >+ >+class GPUPipelineLayout : public RefCounted<GPUPipelineLayout> { >+public: >+ static Ref<GPUPipelineLayout> create(GPUPipelineLayoutDescriptor&&); >+ >+private: >+ explicit GPUPipelineLayout(GPUPipelineLayoutDescriptor&&); >+ >+ GPUPipelineLayoutDescriptor m_descriptor; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/platform/graphics/gpu/GPUPipelineLayoutDescriptor.h b/Source/WebCore/platform/graphics/gpu/GPUPipelineLayoutDescriptor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..3a09189938582bc278c158fda1b279c186775569 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUPipelineLayoutDescriptor.h >@@ -0,0 +1,42 @@ >+/* >+ * 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/Vector.h> >+ >+namespace WebCore { >+ >+struct GPUPipelineLayoutDescriptor { >+ Vector<RefPtr<const GPUBindGroupLayout>> bindGroupLayouts; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9130b17f1d975a5a68a5e5ea58d82ef1972b36ce..cf4c0ee89d7a487c94fb900e22a82b1613856e57 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-18 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] WebGPUPipelineLayout/Descriptor and device::createPipelineLayout >+ https://bugs.webkit.org/show_bug.cgi?id=192843 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update bind-group-layouts and rename to match new PipelineLayout functionality. >+ >+ * webgpu/bind-group-layouts-expected.txt: Removed. >+ * webgpu/pipeline-layouts-expected.txt: Added. >+ * webgpu/pipeline-layouts.html: Renamed from LayoutTests/webgpu/bind-group-layouts.html. >+ > 2018-12-18 Justin Fan <justin_fan@apple.com> > > [WebGPU] BindGroupLayout and Device::createBindGroupLayout >diff --git a/LayoutTests/webgpu/bind-group-layouts-expected.txt b/LayoutTests/webgpu/bind-group-layouts-expected.txt >deleted file mode 100644 >index f143ee6ba86210b5aa538282df2a2dcaad7c89b0..0000000000000000000000000000000000000000 >--- a/LayoutTests/webgpu/bind-group-layouts-expected.txt >+++ /dev/null >@@ -1,4 +0,0 @@ >- >-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 >deleted file mode 100644 >index 06b1eb57a79b602f11d4b8905fe74799464ac4a8..0000000000000000000000000000000000000000 >--- a/LayoutTests/webgpu/bind-group-layouts.html >+++ /dev/null >@@ -1,30 +0,0 @@ >-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] --> >-<meta charset=utf-8> >-<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> >-function createBindGroupLayoutBinding() { >- return { >- binding: 0, >- visibility: WebGPUShaderStageBit.FRAGMENT | WebGPUShaderStageBit.VERTEX, >- type: "storageBuffer" >- }; >-} >- >-test(() => { >- 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 >diff --git a/LayoutTests/webgpu/pipeline-layouts-expected.txt b/LayoutTests/webgpu/pipeline-layouts-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a87787d32004a1933901be740efc4da22f4e097c >--- /dev/null >+++ b/LayoutTests/webgpu/pipeline-layouts-expected.txt >@@ -0,0 +1,4 @@ >+ >+PASS Create a basic WebGPUBindGroupLayoutDescriptor. >+PASS Create a basic WebGPUPipelineLayout wtih a WebGPUDevice. >+ >diff --git a/LayoutTests/webgpu/pipeline-layouts.html b/LayoutTests/webgpu/pipeline-layouts.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2167f6def2dd26d7233622cb41b4c50e46afbf4e >--- /dev/null >+++ b/LayoutTests/webgpu/pipeline-layouts.html >@@ -0,0 +1,33 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] --> >+<meta charset=utf-8> >+<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> >+function createBindGroupLayoutBinding() { >+ return { >+ binding: 0, >+ visibility: WebGPUShaderStageBit.FRAGMENT | WebGPUShaderStageBit.VERTEX, >+ type: "storageBuffer" >+ }; >+} >+ >+test(() => { >+ 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"); >+ >+ const pipelineLayout = device.createPipelineLayout({ bindGroupLayouts: [bindGroupLayout] }); >+ assert_true(pipelineLayout instanceof WebGPUPipelineLayout, "createPipelineLayout returned a WebGPUPipelineLayout"); >+}, "Create a basic WebGPUPipelineLayout wtih 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 192843
:
357652
|
357653
|
357700
|
357747