Title: [241328] trunk
Revision
241328
Author
justin_...@apple.com
Date
2019-02-12 16:23:10 -0800 (Tue, 12 Feb 2019)

Log Message

[WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
https://bugs.webkit.org/show_bug.cgi?id=194552

Reviewed by Dean Jackson.

WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
Source/WebCore:

Consolidate the two versions of these classes in our implementation.

Affected layout tests updated with new names. No change in behavior.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
* Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
* Modules/webgpu/WebGPUBufferUsage.h: Removed.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
* platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.

LayoutTests:

Update affected tests to match.

* webgpu/bind-groups.html:
* webgpu/buffer-resource-triangles.html:
* webgpu/buffers.html:
* webgpu/depth-enabled-triangle-strip.html:
* webgpu/vertex-buffer-triangle-strip.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (241327 => 241328)


--- trunk/LayoutTests/ChangeLog	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/LayoutTests/ChangeLog	2019-02-13 00:23:10 UTC (rev 241328)
@@ -1,3 +1,19 @@
+2019-02-12  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
+        https://bugs.webkit.org/show_bug.cgi?id=194552
+
+        Reviewed by Dean Jackson.
+
+        WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
+        Update affected tests to match.
+
+        * webgpu/bind-groups.html:
+        * webgpu/buffer-resource-triangles.html:
+        * webgpu/buffers.html:
+        * webgpu/depth-enabled-triangle-strip.html:
+        * webgpu/vertex-buffer-triangle-strip.html:
+
 2019-02-12  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Allow pages to trigger programmatic paste from script on iOS

Modified: trunk/LayoutTests/webgpu/bind-groups.html (241327 => 241328)


--- trunk/LayoutTests/webgpu/bind-groups.html	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/LayoutTests/webgpu/bind-groups.html	2019-02-13 00:23:10 UTC (rev 241328)
@@ -19,7 +19,7 @@
 
     const bindGroupLayout = device.createBindGroupLayout({ bindings: [bufferLayoutBinding] });
 
-    const buffer = device.createBuffer({ size: 16, usage: WebGPUBufferUsage.STORAGE });
+    const buffer = device.createBuffer({ size: 16, usage: GPUBufferUsage.STORAGE });
     const bufferBinding = { buffer: buffer, offset: 0, size: 16 };
     const bindGroupBinding = { binding: 1, resource: bufferBinding };
 

Modified: trunk/LayoutTests/webgpu/buffer-resource-triangles.html (241327 => 241328)


--- trunk/LayoutTests/webgpu/buffer-resource-triangles.html	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/LayoutTests/webgpu/buffer-resource-triangles.html	2019-02-13 00:23:10 UTC (rev 241328)
@@ -82,7 +82,7 @@
 
 // FIXME: Keep up to date with buffer upload decisions.
 function createVerticesBuffer(device) {
-    const buffer = device.createBuffer({ size:verticesBufferSize, usage: WebGPUBufferUsage.VERTEX });
+    const buffer = device.createBuffer({ size:verticesBufferSize, usage: GPUBufferUsage.VERTEX });
 
     const vertices = [
         0, 1, 0, 1,
@@ -97,7 +97,7 @@
 }
 
 function createFloat4Buffer(device, a, b) {
-    const buffer = device.createBuffer({ size: vertexSize, usage: WebGPUBufferUsage.UNIFORM });
+    const buffer = device.createBuffer({ size: vertexSize, usage: GPUBufferUsage.UNIFORM });
     
     const arrayBuffer = buffer.mapping;
     const floatArray = new Float32Array(arrayBuffer);

Modified: trunk/LayoutTests/webgpu/buffers.html (241327 => 241328)


--- trunk/LayoutTests/webgpu/buffers.html	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/LayoutTests/webgpu/buffers.html	2019-02-13 00:23:10 UTC (rev 241328)
@@ -8,7 +8,7 @@
 <script src=""
 <script>
 function createBuffer() {
-    const buffer = defaultDevice.createBuffer({ size: 16, usage: WebGPUBufferUsage.MAP_WRITE });
+    const buffer = defaultDevice.createBuffer({ size: 16, usage: GPUBufferUsage.MAP_WRITE });
     assert_true(buffer instanceof WebGPUBuffer, "createBuffer returned a WebGPUBuffer");
     
     let arrayBuffer = buffer.mapping;

Modified: trunk/LayoutTests/webgpu/depth-enabled-triangle-strip.html (241327 => 241328)


--- trunk/LayoutTests/webgpu/depth-enabled-triangle-strip.html	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/LayoutTests/webgpu/depth-enabled-triangle-strip.html	2019-02-13 00:23:10 UTC (rev 241328)
@@ -46,7 +46,7 @@
 
 function createVertexBuffer(device) {
     const bufferSize = 4 * 4 * 4;
-    const buffer = device.createBuffer({ size: bufferSize, usage: WebGPUBufferUsage.MAP_WRITE });
+    const buffer = device.createBuffer({ size: bufferSize, usage: GPUBufferUsage.MAP_WRITE });
     
     let floatArray = new Float32Array(buffer.mapping);
 

Modified: trunk/LayoutTests/webgpu/vertex-buffer-triangle-strip.html (241327 => 241328)


--- trunk/LayoutTests/webgpu/vertex-buffer-triangle-strip.html	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/LayoutTests/webgpu/vertex-buffer-triangle-strip.html	2019-02-13 00:23:10 UTC (rev 241328)
@@ -40,7 +40,7 @@
 
 function createVertexBuffer(device) {
     const bufferSize = 4 * 5 * 4;
-    const buffer = device.createBuffer({ size: bufferSize, usage: WebGPUBufferUsage.MAP_WRITE });
+    const buffer = device.createBuffer({ size: bufferSize, usage: GPUBufferUsage.MAP_WRITE });
     
     let floatArray = new Float32Array(buffer.mapping);
 

Modified: trunk/Source/WebCore/CMakeLists.txt (241327 => 241328)


--- trunk/Source/WebCore/CMakeLists.txt	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/CMakeLists.txt	2019-02-13 00:23:10 UTC (rev 241328)
@@ -462,6 +462,8 @@
     Modules/webdriver/NavigatorWebDriver.idl
 
     Modules/webgpu/DOMWindowWebGPU.idl
+    Modules/webgpu/GPUBufferDescriptor.idl
+    Modules/webgpu/GPUBufferUsage.idl
     Modules/webgpu/GPUColor.idl
     Modules/webgpu/GPUCompareFunction.idl
     Modules/webgpu/GPUDepthStencilStateDescriptor.idl
@@ -483,8 +485,6 @@
     Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl
     Modules/webgpu/WebGPUBuffer.idl
     Modules/webgpu/WebGPUBufferBinding.idl
-    Modules/webgpu/WebGPUBufferDescriptor.idl
-    Modules/webgpu/WebGPUBufferUsage.idl
     Modules/webgpu/WebGPUCommandBuffer.idl
     Modules/webgpu/WebGPUDevice.idl
     Modules/webgpu/WebGPUIndexFormat.idl

Modified: trunk/Source/WebCore/ChangeLog (241327 => 241328)


--- trunk/Source/WebCore/ChangeLog	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/ChangeLog	2019-02-13 00:23:10 UTC (rev 241328)
@@ -1,3 +1,32 @@
+2019-02-12  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
+        https://bugs.webkit.org/show_bug.cgi?id=194552
+
+        Reviewed by Dean Jackson.
+
+        WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
+        Consolidate the two versions of these classes in our implementation.
+
+        Affected layout tests updated with new names. No change in behavior.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
+        * Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
+        * Modules/webgpu/WebGPUBufferUsage.h: Removed.
+        * Modules/webgpu/WebGPUDevice.cpp:
+        (WebCore::WebGPUDevice::createBuffer const):
+        * Modules/webgpu/WebGPUDevice.h:
+        * Modules/webgpu/WebGPUDevice.idl:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
+        * platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
+
 2019-02-12  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Unreviewed, try to fix the internal iOS build after r241321

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (241327 => 241328)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-02-13 00:23:10 UTC (rev 241328)
@@ -322,6 +322,8 @@
 $(PROJECT_DIR)/Modules/webdriver/NavigatorWebDriver.idl
 $(PROJECT_DIR)/Modules/webgpu/DOMWindowWebGPU.idl
 $(PROJECT_DIR)/Modules/webgpu/GPUColor.idl
+$(PROJECT_DIR)/Modules/webgpu/GPUBufferDescriptor.idl
+$(PROJECT_DIR)/Modules/webgpu/GPUBufferUsage.idl
 $(PROJECT_DIR)/Modules/webgpu/GPUCompareFunction.idl
 $(PROJECT_DIR)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl
 $(PROJECT_DIR)/Modules/webgpu/GPUExtent3D.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (241327 => 241328)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-02-13 00:23:10 UTC (rev 241328)
@@ -580,6 +580,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGCObservation.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUColor.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUColor.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUBufferDescriptor.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUBufferDescriptor.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUBufferUsage.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUBufferUsage.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCompareFunction.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCompareFunction.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDepthStencilStateDescriptor.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (241327 => 241328)


--- trunk/Source/WebCore/DerivedSources.make	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/DerivedSources.make	2019-02-13 00:23:10 UTC (rev 241328)
@@ -373,6 +373,8 @@
     $(WebCore)/Modules/webdriver/NavigatorWebDriver.idl \
     $(WebCore)/Modules/webgpu/DOMWindowWebGPU.idl \
     $(WebCore)/Modules/webgpu/GPUColor.idl \
+    $(WebCore)/Modules/webgpu/GPUBufferDescriptor.idl \
+    $(WebCore)/Modules/webgpu/GPUBufferUsage.idl \
     $(WebCore)/Modules/webgpu/GPUCompareFunction.idl \
     $(WebCore)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl \
     $(WebCore)/Modules/webgpu/GPUExtent3D.idl \
@@ -393,8 +395,6 @@
     $(WebCore)/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl \
     $(WebCore)/Modules/webgpu/WebGPUBuffer.idl \
 	$(WebCore)/Modules/webgpu/WebGPUBufferBinding.idl \
-    $(WebCore)/Modules/webgpu/WebGPUBufferDescriptor.idl \
-    $(WebCore)/Modules/webgpu/WebGPUBufferUsage.idl \
     $(WebCore)/Modules/webgpu/WebGPUCommandBuffer.idl \
     $(WebCore)/Modules/webgpu/WebGPUDevice.idl \
     $(WebCore)/Modules/webgpu/WebGPUIndexFormat.idl \

Copied: trunk/Source/WebCore/Modules/webgpu/GPUBufferDescriptor.idl (from rev 241327, trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl) (0 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/GPUBufferDescriptor.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUBufferDescriptor.idl	2019-02-13 00:23:10 UTC (rev 241328)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2019 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 GPUBufferUsageFlags;
+
+[
+    Conditional=WEBGPU,
+    EnabledAtRuntime=WebGPU
+] dictionary GPUBufferDescriptor {
+    u32 size;
+    GPUBufferUsageFlags usage;
+};

Copied: trunk/Source/WebCore/Modules/webgpu/GPUBufferUsage.idl (from rev 241327, trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl) (0 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/GPUBufferUsage.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUBufferUsage.idl	2019-02-13 00:23:10 UTC (rev 241328)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2019 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,
+    DoNotCheckConstants,
+    EnabledAtRuntime=WebGPU,
+    ImplementationLacksVTable
+] interface GPUBufferUsage {
+    const u32 NONE = 0;
+    const u32 MAP_READ = 1;
+    const u32 MAP_WRITE = 2;
+    const u32 TRANSFER_SRC = 4;
+    const u32 TRANSFER_DST = 8;
+    const u32 INDEX = 16;
+    const u32 VERTEX = 32;
+    const u32 UNIFORM = 64;
+    const u32 STORAGE = 128;
+};

Deleted: trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.h (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.h	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.h	2019-02-13 00:23:10 UTC (rev 241328)
@@ -1,39 +0,0 @@
-/*
- * 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 "GPUBufferDescriptor.h"
-
-namespace WebCore {
-
-using WebGPUBufferDescriptor = GPUBufferDescriptor;
-using WebGPUBufferUsageFlags = GPUBufferUsageFlags;
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGPU)

Deleted: trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl	2019-02-13 00:23:10 UTC (rev 241328)
@@ -1,36 +0,0 @@
-/*
- * 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 WebGPUBufferUsageFlags;
-
-[
-    Conditional=WEBGPU,
-    EnabledAtRuntime=WebGPU
-] dictionary WebGPUBufferDescriptor {
-    u32 size;
-    WebGPUBufferUsageFlags usage;
-};

Deleted: trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.h (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.h	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.h	2019-02-13 00:23:10 UTC (rev 241328)
@@ -1,38 +0,0 @@
-/*
- * 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 "GPUBufferDescriptor.h"
-
-namespace WebCore {
-
-using WebGPUBufferUsage = GPUBufferUsage;
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGPU)

Deleted: trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl	2019-02-13 00:23:10 UTC (rev 241328)
@@ -1,42 +0,0 @@
-/*
- * 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,
-    DoNotCheckConstants,
-    EnabledAtRuntime=WebGPU,
-    ImplementationLacksVTable
-] interface WebGPUBufferUsage {
-    const u32 NONE = 0;
-    const u32 MAP_READ = 1;
-    const u32 MAP_WRITE = 2;
-    const u32 TRANSFER_SRC = 4;
-    const u32 TRANSFER_DST = 8;
-    const u32 INDEX = 16;
-    const u32 VERTEX = 32;
-    const u32 UNIFORM = 64;
-    const u32 STORAGE = 128;
-};

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp	2019-02-13 00:23:10 UTC (rev 241328)
@@ -32,6 +32,7 @@
 #include "GPUBindGroupBinding.h"
 #include "GPUBindGroupDescriptor.h"
 #include "GPUBufferBinding.h"
+#include "GPUBufferDescriptor.h"
 #include "GPUCommandBuffer.h"
 #include "GPUPipelineStageDescriptor.h"
 #include "GPURenderPipelineDescriptor.h"
@@ -72,10 +73,9 @@
     UNUSED_PARAM(m_adapter);
 }
 
-RefPtr<WebGPUBuffer> WebGPUDevice::createBuffer(WebGPUBufferDescriptor&& descriptor) const
+RefPtr<WebGPUBuffer> WebGPUDevice::createBuffer(GPUBufferDescriptor&& descriptor) const
 {
-    // FIXME: Validation on descriptor needed?
-    if (auto buffer = m_device->createBuffer(GPUBufferDescriptor { descriptor.size, descriptor.usage }))
+    if (auto buffer = m_device->createBuffer(WTFMove(descriptor)))
         return WebGPUBuffer::create(buffer.releaseNonNull());
     return nullptr;
 }

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h	2019-02-13 00:23:10 UTC (rev 241328)
@@ -30,7 +30,6 @@
 #include "GPUDevice.h"
 #include "WebGPUAdapter.h"
 #include "WebGPUBindGroupLayoutDescriptor.h"
-#include "WebGPUBufferDescriptor.h"
 #include "WebGPUQueue.h"
 
 #include <wtf/Ref.h>
@@ -49,6 +48,7 @@
 class WebGPUShaderModule;
 class WebGPUTexture;
 
+struct GPUBufferDescriptor;
 struct GPUTextureDescriptor;
 struct WebGPUBindGroupDescriptor;
 struct WebGPUPipelineLayoutDescriptor;
@@ -62,7 +62,7 @@
     const WebGPUAdapter& adapter() const { return m_adapter.get(); }
     const GPUDevice& device() const { return m_device.get(); }
 
-    RefPtr<WebGPUBuffer> createBuffer(WebGPUBufferDescriptor&&) const;
+    RefPtr<WebGPUBuffer> createBuffer(GPUBufferDescriptor&&) const;
     Ref<WebGPUTexture> createTexture(GPUTextureDescriptor&&) const;
 
     Ref<WebGPUBindGroupLayout> createBindGroupLayout(WebGPUBindGroupLayoutDescriptor&&) const;

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.idl (241327 => 241328)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.idl	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.idl	2019-02-13 00:23:10 UTC (rev 241328)
@@ -31,7 +31,7 @@
 ] interface WebGPUDevice {
     readonly attribute WebGPUAdapter adapter;
 
-    WebGPUBuffer createBuffer(WebGPUBufferDescriptor descriptor);
+    WebGPUBuffer createBuffer(GPUBufferDescriptor descriptor);
     WebGPUTexture createTexture(GPUTextureDescriptor descriptor);
 
     WebGPUBindGroupLayout createBindGroupLayout(WebGPUBindGroupLayoutDescriptor descriptor);

Modified: trunk/Source/WebCore/Sources.txt (241327 => 241328)


--- trunk/Source/WebCore/Sources.txt	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/Sources.txt	2019-02-13 00:23:10 UTC (rev 241328)
@@ -2767,6 +2767,8 @@
 JSFontFace.cpp
 JSFontFaceSet.cpp
 JSGPUColor.cpp
+JSGPUBufferDescriptor.cpp
+JSGPUBufferUsage.cpp
 JSGPUCompareFunction.cpp
 JSGPUDepthStencilStateDescriptor.cpp
 JSGPUExtent3D.cpp
@@ -3315,8 +3317,6 @@
 JSWebGPUBindGroupLayoutDescriptor.cpp
 JSWebGPUBuffer.cpp
 JSWebGPUBufferBinding.cpp
-JSWebGPUBufferDescriptor.cpp
-JSWebGPUBufferUsage.cpp
 JSWebGPUCommandBuffer.cpp
 JSWebGPUDevice.cpp
 JSWebGPUIndexFormat.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (241327 => 241328)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-02-13 00:23:10 UTC (rev 241328)
@@ -4263,7 +4263,6 @@
 		D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B0556609C6700100307E43 /* CreateLinkCommand.h */; };
 		D0BC54491443AC4A00E105DA /* CachedStyleSheetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */; };
-		D0D8648421B61727003C983C /* WebGPUBufferDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D8648221B61727003C983C /* WebGPUBufferDescriptor.h */; };
 		D0EDA775143E303C0028E383 /* CachedRawResource.h in Headers */ = {isa = PBXBuildFile; fileRef = D0EDA773143E303C0028E383 /* CachedRawResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		D0FF2A5E11F8C45A007E74E0 /* PingLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = D0FF2A5C11F8C45A007E74E0 /* PingLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		D302754A12A5FE84004BD828 /* RenderDetailsMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = D302754612A5FE84004BD828 /* RenderDetailsMarker.h */; };
@@ -13959,6 +13958,9 @@
 		D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; };
 		D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; };
 		D01B811222125AFC00627B6C /* GPUColor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUColor.idl; sourceTree = "<group>"; };
+		D01B811922135EB900627B6C /* GPUBufferDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUBufferDescriptor.idl; sourceTree = "<group>"; };
+		D01B811C2213627300627B6C /* GPUBufferUsage.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUBufferUsage.idl; sourceTree = "<group>"; };
+		D01B811D2213636E00627B6C /* GPUBufferUsage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBufferUsage.h; sourceTree = "<group>"; };
 		D0232B5821CB49B7009483B9 /* GPUBindGroupLayoutMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUBindGroupLayoutMetal.mm; sourceTree = "<group>"; };
 		D02454D021C4A41C00B73628 /* GPUBindGroupLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBindGroupLayout.h; sourceTree = "<group>"; };
 		D026F47D220A2AC600AC5F49 /* GPUExtent3D.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUExtent3D.h; sourceTree = "<group>"; };
@@ -14056,8 +14058,6 @@
 		D0615FCC217FE5C6008A48A8 /* WebGPUShaderModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUShaderModule.h; sourceTree = "<group>"; };
 		D0615FCD217FE5C6008A48A8 /* WebGPUShaderModule.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUShaderModule.cpp; sourceTree = "<group>"; };
 		D0615FCE217FE5C6008A48A8 /* WebGPUShaderModule.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUShaderModule.idl; sourceTree = "<group>"; };
-		D063AE3F21C05DDD000E6A35 /* WebGPUBufferUsage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUBufferUsage.h; sourceTree = "<group>"; };
-		D063AE4021C05DDD000E6A35 /* WebGPUBufferUsage.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBufferUsage.idl; sourceTree = "<group>"; };
 		D063AE4421C0617D000E6A35 /* WebGPUVertexFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUVertexFormat.h; sourceTree = "<group>"; };
 		D063AE4521C0617D000E6A35 /* WebGPUVertexFormat.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUVertexFormat.idl; sourceTree = "<group>"; };
 		D063AE4621C06626000E6A35 /* WebGPUInputStepMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUInputStepMode.h; sourceTree = "<group>"; };
@@ -14137,8 +14137,6 @@
 		D0CAAE9C216824A7001C91C7 /* WebMetalComputeCommandEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebMetalComputeCommandEncoder.cpp; sourceTree = "<group>"; };
 		D0CAAE9D216824A7001C91C7 /* WebMetalBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebMetalBuffer.h; sourceTree = "<group>"; };
 		D0CAAE9E216824A8001C91C7 /* WebMetalCommandBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebMetalCommandBuffer.cpp; sourceTree = "<group>"; };
-		D0D8648221B61727003C983C /* WebGPUBufferDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUBufferDescriptor.h; sourceTree = "<group>"; };
-		D0D8648321B61727003C983C /* WebGPUBufferDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBufferDescriptor.idl; sourceTree = "<group>"; };
 		D0D8648721B64CAA003C983C /* GPUBufferDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBufferDescriptor.h; sourceTree = "<group>"; };
 		D0D8648C21B70676003C983C /* WebGPUBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUBuffer.h; sourceTree = "<group>"; };
 		D0D8648D21B70676003C983C /* WebGPUBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUBuffer.cpp; sourceTree = "<group>"; };
@@ -18483,6 +18481,7 @@
 				D0D8649221B760F2003C983C /* GPUBuffer.h */,
 				D0BE104A21E6872F00E42A89 /* GPUBufferBinding.h */,
 				D0D8648721B64CAA003C983C /* GPUBufferDescriptor.h */,
+				D01B811D2213636E00627B6C /* GPUBufferUsage.h */,
 				D001D9AB21B0C7BF0023B9BC /* GPUColor.h */,
 				312FF8BD21A4C2F100EB199D /* GPUCommandBuffer.h */,
 				D03C849C21FFC7FC0002227F /* GPUCompareFunction.h */,
@@ -26080,6 +26079,8 @@
 				D00F5941216ECC7A000D71DB /* DOMWindowWebGPU.cpp */,
 				D00F5940216ECC7A000D71DB /* DOMWindowWebGPU.h */,
 				D00F5942216ECC7A000D71DB /* DOMWindowWebGPU.idl */,
+				D01B811922135EB900627B6C /* GPUBufferDescriptor.idl */,
+				D01B811C2213627300627B6C /* GPUBufferUsage.idl */,
 				D01B811222125AFC00627B6C /* GPUColor.idl */,
 				D03C849E21FFCF000002227F /* GPUCompareFunction.idl */,
 				D03C84A221FFD7230002227F /* GPUDepthStencilStateDescriptor.idl */,
@@ -26116,10 +26117,6 @@
 				D0D8648E21B70676003C983C /* WebGPUBuffer.idl */,
 				D0BE104C21E68F1500E42A89 /* WebGPUBufferBinding.h */,
 				D0BE104D21E68F1500E42A89 /* WebGPUBufferBinding.idl */,
-				D0D8648221B61727003C983C /* WebGPUBufferDescriptor.h */,
-				D0D8648321B61727003C983C /* WebGPUBufferDescriptor.idl */,
-				D063AE3F21C05DDD000E6A35 /* WebGPUBufferUsage.h */,
-				D063AE4021C05DDD000E6A35 /* WebGPUBufferUsage.idl */,
 				D0EACF7721937228000FA75C /* WebGPUCommandBuffer.cpp */,
 				D0EACF7621937228000FA75C /* WebGPUCommandBuffer.h */,
 				D0EACF7821937228000FA75C /* WebGPUCommandBuffer.idl */,
@@ -32334,7 +32331,6 @@
 				0C3F1F5B10C8871200D72CE1 /* WebGLUniformLocation.h in Headers */,
 				6F995A261A7078B100A735F4 /* WebGLVertexArrayObject.h in Headers */,
 				77A17A7812F28642004E02F6 /* WebGLVertexArrayObjectOES.h in Headers */,
-				D0D8648421B61727003C983C /* WebGPUBufferDescriptor.h in Headers */,
 				318436DE21B9DAAF00ED383E /* WebGPULayer.h in Headers */,
 				A5B81CB71FAA44620037D1E6 /* WebHeapAgent.h in Headers */,
 				A5840E25187B8AC200843B10 /* WebInjectedScriptHost.h in Headers */,

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (241327 => 241328)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2019-02-13 00:23:10 UTC (rev 241328)
@@ -81,6 +81,7 @@
     macro(Gamepad) \
     macro(GamepadButton) \
     macro(GamepadEvent) \
+    macro(GPUBufferUsage) \
     macro(GPUTextureUsage) \
     macro(HTMLAttachmentElement) \
     macro(HTMLAudioElement) \
@@ -196,7 +197,6 @@
     macro(WebGPUBindGroup) \
     macro(WebGPUBindGroupLayout) \
     macro(WebGPUBuffer) \
-    macro(WebGPUBufferUsage) \
     macro(WebGPUCommandBuffer) \
     macro(WebGPUDevice) \
     macro(WebGPUIndexFormat) \

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUBufferDescriptor.h (241327 => 241328)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUBufferDescriptor.h	2019-02-13 00:19:04 UTC (rev 241327)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUBufferDescriptor.h	2019-02-13 00:23:10 UTC (rev 241328)
@@ -27,32 +27,15 @@
 
 #if ENABLE(WEBGPU)
 
-#include <wtf/RefCounted.h>
+#include "GPUBufferUsage.h"
 
 namespace WebCore {
 
-using GPUBufferUsageFlags = unsigned long;
-
 struct GPUBufferDescriptor {
     unsigned long size;
     GPUBufferUsageFlags usage;
 };
 
-class GPUBufferUsage : public RefCounted<GPUBufferUsage> {
-public:
-    enum Flags : GPUBufferUsageFlags {
-        None = 0,
-        MapRead = 1,
-        MapWrite = 2,
-        TransferSrc = 4,
-        TransferDst = 8,
-        Index = 16,
-        Vertex = 32,
-        Uniform = 64,
-        Storage = 128
-    };
-};
-
 } // namespace WebCore
 
 #endif // ENABLE(WEBGPU)

Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUBufferUsage.h (from rev 241327, trunk/Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.h) (0 => 241328)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUBufferUsage.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUBufferUsage.h	2019-02-13 00:23:10 UTC (rev 241328)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2019 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 GPUBufferUsageFlags = unsigned long;
+
+class GPUBufferUsage : public RefCounted<GPUBufferUsage> {
+public:
+    enum class Flags : GPUBufferUsageFlags {
+        None = 0,
+        MapRead = 1,
+        MapWrite = 2,
+        TransferSrc = 4,
+        TransferDst = 8,
+        Index = 16,
+        Vertex = 32,
+        Uniform = 64,
+        Storage = 128
+    };
+};
+
+} // 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