Title: [239410] trunk
Revision
239410
Author
justin_...@apple.com
Date
2018-12-19 16:59:13 -0800 (Wed, 19 Dec 2018)

Log Message

[WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
https://bugs.webkit.org/show_bug.cgi?id=192843
<rdar://problem/46820395>

Reviewed by Myles Maxfield.

Source/WebCore:

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:

Add missing include:
* Modules/webgpu/WebGPUQueue.h:

LayoutTests:

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.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (239409 => 239410)


--- trunk/LayoutTests/ChangeLog	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/LayoutTests/ChangeLog	2018-12-20 00:59:13 UTC (rev 239410)
@@ -1,3 +1,17 @@
+2018-12-19  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
+        https://bugs.webkit.org/show_bug.cgi?id=192843
+        <rdar://problem/46820395>
+
+        Reviewed by Myles Maxfield.
+
+        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-19  Ryan Haddad  <ryanhad...@apple.com>
 
         REGRESSION: [ iOS Sim ] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-missing-import-scripts.https.html is failing

Deleted: trunk/LayoutTests/webgpu/bind-group-layouts-expected.txt (239409 => 239410)


--- trunk/LayoutTests/webgpu/bind-group-layouts-expected.txt	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/LayoutTests/webgpu/bind-group-layouts-expected.txt	2018-12-20 00:59:13 UTC (rev 239410)
@@ -1,4 +0,0 @@
-
-PASS Create a basic WebGPUBindGroupLayoutDescriptor. 
-PASS Create a basic WebGPUBindGroupLayout with a WebGPUDevice. 
-

Deleted: trunk/LayoutTests/webgpu/bind-group-layouts.html (239409 => 239410)


--- trunk/LayoutTests/webgpu/bind-group-layouts.html	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/LayoutTests/webgpu/bind-group-layouts.html	2018-12-20 00:59:13 UTC (rev 239410)
@@ -1,30 +0,0 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
-<meta charset=utf-8>
-<title>Create WebGPUBindGroupLayout.</title>
-<body>
-<script src=""
-<script src=""
-<script src=""
-<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

Added: trunk/LayoutTests/webgpu/pipeline-layouts-expected.txt (0 => 239410)


--- trunk/LayoutTests/webgpu/pipeline-layouts-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/pipeline-layouts-expected.txt	2018-12-20 00:59:13 UTC (rev 239410)
@@ -0,0 +1,4 @@
+
+PASS Create a basic WebGPUBindGroupLayoutDescriptor. 
+PASS Create a basic WebGPUPipelineLayout wtih a WebGPUDevice. 
+

Copied: trunk/LayoutTests/webgpu/pipeline-layouts.html (from rev 239408, trunk/LayoutTests/webgpu/bind-group-layouts.html) (0 => 239410)


--- trunk/LayoutTests/webgpu/pipeline-layouts.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/pipeline-layouts.html	2018-12-20 00:59:13 UTC (rev 239410)
@@ -0,0 +1,33 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<meta charset=utf-8>
+<title>Create WebGPUBindGroupLayout.</title>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<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

Modified: trunk/Source/WebCore/CMakeLists.txt (239409 => 239410)


--- trunk/Source/WebCore/CMakeLists.txt	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/CMakeLists.txt	2018-12-20 00:59:13 UTC (rev 239410)
@@ -477,6 +477,8 @@
     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

Modified: trunk/Source/WebCore/ChangeLog (239409 => 239410)


--- trunk/Source/WebCore/ChangeLog	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/ChangeLog	2018-12-20 00:59:13 UTC (rev 239410)
@@ -1,3 +1,48 @@
+2018-12-19  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
+        https://bugs.webkit.org/show_bug.cgi?id=192843
+        <rdar://problem/46820395>
+
+        Reviewed by Myles Maxfield.
+
+        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:
+
+        Add missing include:
+        * Modules/webgpu/WebGPUQueue.h:
+
 2018-12-18  Ryosuke Niwa  <rn...@webkit.org>
 
         SVGUseElement::findTarget should return nullptr when there is a cycle

Modified: trunk/Source/WebCore/DerivedSources.make (239409 => 239410)


--- trunk/Source/WebCore/DerivedSources.make	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/DerivedSources.make	2018-12-20 00:59:13 UTC (rev 239410)
@@ -389,6 +389,8 @@
     $(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 \

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp (239409 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp	2018-12-20 00:59:13 UTC (rev 239410)
@@ -36,7 +36,7 @@
 }
 
 WebGPUBindGroupLayout::WebGPUBindGroupLayout(Ref<GPUBindGroupLayout>&& layout)
-    : m_layout(WTFMove(layout))
+    : m_bindGroupLayout(WTFMove(layout))
 {
 }
 

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h (239409 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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 @@
 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

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp (239409 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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 @@
     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?

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h (239409 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -43,9 +43,11 @@
 class WebGPUBindGroupLayout;
 class WebGPUBuffer;
 class WebGPUCommandBuffer;
+class WebGPUPipelineLayout;
 class WebGPURenderPipeline;
 class WebGPUShaderModule;
 
+struct WebGPUPipelineLayoutDescriptor;
 struct WebGPURenderPipelineDescriptor;
 struct WebGPUShaderModuleDescriptor;
 
@@ -59,6 +61,7 @@
     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;

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.idl (239409 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.idl	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.idl	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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);

Copied: trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.cpp (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp) (0 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.cpp	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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)

Copied: trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.h (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h) (0 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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)

Copied: trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.idl (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp) (0 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayout.idl	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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 {
+};

Copied: trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.h (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp) (0 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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)

Copied: trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp) (0 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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;
+};

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUQueue.h (239409 => 239410)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUQueue.h	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUQueue.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -31,6 +31,7 @@
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/Sources.txt (239409 => 239410)


--- trunk/Source/WebCore/Sources.txt	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/Sources.txt	2018-12-20 00:59:13 UTC (rev 239410)
@@ -309,6 +309,7 @@
 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
@@ -1745,6 +1746,7 @@
 
 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
@@ -3242,6 +3244,8 @@
 JSWebGPUInputStepMode.cpp
 JSWebGPUQueue.cpp
 JSWebGPUPipelineDescriptorBase.cpp
+JSWebGPUPipelineLayout.cpp
+JSWebGPUPipelineLayoutDescriptor.cpp
 JSWebGPUPipelineStageDescriptor.cpp
 JSWebGPUProgrammablePassEncoder.cpp
 JSWebGPURenderingContext.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (239409 => 239410)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-12-20 00:59:13 UTC (rev 239410)
@@ -13722,6 +13722,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>"; };
@@ -13810,6 +13813,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>"; };
@@ -18070,6 +18078,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 */,
@@ -25612,6 +25623,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 */,

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (239409 => 239410)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -198,6 +198,7 @@
     macro(WebGPUIndexFormat) \
     macro(WebGPUInputStepMode) \
     macro(WebGPUQueue) \
+    macro(WebGPUPipelineLayout) \
     macro(WebGPUProgrammablePassEncoder) \
     macro(WebGPURenderingContext) \
     macro(WebGPURenderPassEncoder) \

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp (239409 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp	2018-12-20 00:59:13 UTC (rev 239410)
@@ -35,9 +35,9 @@
     return adoptRef(*new GPUBindGroupLayout(WTFMove(descriptor)));
 }
 
-GPUBindGroupLayout::GPUBindGroupLayout(GPUBindGroupLayoutDescriptor&& descriptor)
-    : m_descriptor(WTFMove(descriptor))
+GPUBindGroupLayout::GPUBindGroupLayout(GPUBindGroupLayoutDescriptor&&)
 {
+    // FIXME: Stub implementation.
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h (239409 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -40,8 +40,6 @@
 
 private:
     GPUBindGroupLayout(GPUBindGroupLayoutDescriptor&&);
-
-    GPUBindGroupLayoutDescriptor m_descriptor;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp (239409 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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 @@
     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));

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h (239409 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h	2018-12-20 00:58:21 UTC (rev 239409)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -43,13 +43,15 @@
 
 class GPUBindGroupLayout;
 class GPUBuffer;
+class GPUPipelineLayout;
 class GPURenderPipeline;
 class GPUShaderModule;
 
 struct GPUBindGroupLayoutDescriptor;
 struct GPUBufferDescriptor;
+struct GPUPipelineLayoutDescriptor;
+struct GPURenderPipelineDescriptor;
 struct GPUShaderModuleDescriptor;
-struct GPURenderPipelineDescriptor;
 
 class GPUDevice : public RefCounted<GPUDevice> {
 public:
@@ -58,6 +60,7 @@
     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;

Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.cpp (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp) (0 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.cpp	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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&&)
+{
+    // FIXME: Stub implementation.
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.h (from rev 239408, trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.h) (0 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayout.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -0,0 +1,47 @@
+/*
+ * 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&&);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayoutDescriptor.h (from rev 239408, trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp) (0 => 239410)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayoutDescriptor.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUPipelineLayoutDescriptor.h	2018-12-20 00:59:13 UTC (rev 239410)
@@ -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)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to