Diff
Modified: trunk/LayoutTests/ChangeLog (241047 => 241048)
--- trunk/LayoutTests/ChangeLog 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/LayoutTests/ChangeLog 2019-02-06 21:52:57 UTC (rev 241048)
@@ -1,3 +1,17 @@
+2019-02-06 Justin Fan <justin_...@apple.com>
+
+ [Web GPU] Implement supporting dictionaries for GPUTexture
+ https://bugs.webkit.org/show_bug.cgi?id=194354
+
+ Reviewed by Dean Jackson.
+
+ Update test files to use hyphen-case for GPUTextureFormat.
+
+ * webgpu/js/basic-webgpu-functions.js:
+ (async.setUpContexts):
+ * webgpu/js/webgpu-functions.js:
+ (createBasicContext):
+
2019-02-06 David Kilzer <ddkil...@apple.com>
Revert part of r241015 that skipped all WebGL tests
Modified: trunk/LayoutTests/webgpu/js/basic-webgpu-functions.js (241047 => 241048)
--- trunk/LayoutTests/webgpu/js/basic-webgpu-functions.js 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/LayoutTests/webgpu/js/basic-webgpu-functions.js 2019-02-06 21:52:57 UTC (rev 241048)
@@ -74,7 +74,7 @@
}
// FIXME: Implement WebGPUTextureUsageEnum.
- context.configure({ device: defaultDevice, format:"B8G8R8A8Unorm", width: canvas.width, height: canvas.height });
+ context.configure({ device: defaultDevice, format:"b8g8r8a8-unorm", width: canvas.width, height: canvas.height });
}
let shaderModule, vertexStageDescriptor, fragmentStageDescriptor, pipelineDescriptor, renderPipeline;
Modified: trunk/LayoutTests/webgpu/js/webgpu-functions.js (241047 => 241048)
--- trunk/LayoutTests/webgpu/js/webgpu-functions.js 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/LayoutTests/webgpu/js/webgpu-functions.js 2019-02-06 21:52:57 UTC (rev 241048)
@@ -7,7 +7,7 @@
function createBasicContext(canvas, device) {
const context = canvas.getContext("webgpu");
// FIXME: Implement and specify a WebGPUTextureUsageEnum.
- context.configure({ device: device, format:"B8G8R8A8Unorm", width: canvas.width, height: canvas.height });
+ context.configure({ device: device, format:"b8g8r8a8-unorm", width: canvas.width, height: canvas.height });
return context;
}
Modified: trunk/Source/WebCore/CMakeLists.txt (241047 => 241048)
--- trunk/Source/WebCore/CMakeLists.txt 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/CMakeLists.txt 2019-02-06 21:52:57 UTC (rev 241048)
@@ -464,7 +464,12 @@
Modules/webgpu/DOMWindowWebGPU.idl
Modules/webgpu/GPUCompareFunction.idl
Modules/webgpu/GPUDepthStencilStateDescriptor.idl
+ Modules/webgpu/GPUExtent3D.idl
Modules/webgpu/GPURequestAdapterOptions.idl
+ Modules/webgpu/GPUTextureDescriptor.idl
+ Modules/webgpu/GPUTextureDimension.idl
+ Modules/webgpu/GPUTextureFormat.idl
+ Modules/webgpu/GPUTextureUsage.idl
Modules/webgpu/WebGPU.idl
Modules/webgpu/WebGPUAdapter.idl
Modules/webgpu/WebGPUBindGroup.idl
@@ -500,7 +505,6 @@
Modules/webgpu/WebGPUShaderStageBit.idl
Modules/webgpu/WebGPUSwapChain.idl
Modules/webgpu/WebGPUTexture.idl
- Modules/webgpu/WebGPUTextureFormatEnum.idl
Modules/webgpu/WebGPUTextureView.idl
Modules/webgpu/WebGPUVertexAttributeDescriptor.idl
Modules/webgpu/WebGPUVertexFormat.idl
Modified: trunk/Source/WebCore/ChangeLog (241047 => 241048)
--- trunk/Source/WebCore/ChangeLog 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/ChangeLog 2019-02-06 21:52:57 UTC (rev 241048)
@@ -1,3 +1,43 @@
+2019-02-06 Justin Fan <justin_...@apple.com>
+
+ [Web GPU] Implement supporting dictionaries for GPUTexture
+ https://bugs.webkit.org/show_bug.cgi?id=194354
+
+ Reviewed by Dean Jackson.
+
+ Add dictionaries needed to create a GPUTextureDescriptor.
+
+ No new tests; no change in behavior.
+
+ New interface and dictionaries added:
+ * Modules/webgpu/GPUExtent3D.idl:
+ * Modules/webgpu/GPUTextureDescriptor.idl:
+ * Modules/webgpu/GPUTextureDimension.idl:
+ * Modules/webgpu/GPUTextureUsage.idl:
+ * platform/graphics/gpu/GPUExtent3D.h:
+ * platform/graphics/gpu/GPUTextureDescriptor.h:
+ * platform/graphics/gpu/GPUTextureDimension.h:
+ * platform/graphics/gpu/GPUTextureUsage.h:
+
+ Update WebGPUTextureFormatEnum to GPUTextureFormat:
+ * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
+ * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
+ * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
+ * Modules/webgpu/WebGPUSwapChain.cpp:
+ * Modules/webgpu/WebGPUSwapChain.h:
+ * Modules/webgpu/WebGPUSwapChain.idl:
+ * platform/graphics/gpu/GPUSwapChain.h:
+ * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
+ (WebCore::platformTextureFormatForGPUTextureFormat):
+ (WebCore::GPUSwapChain::setFormat):
+
+ Update project files with new symbols:
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/WebCoreBuiltinNames.h:
+
2019-02-06 Dean Jackson <d...@apple.com>
Fix potential build error in GPUDevice
Modified: trunk/Source/WebCore/DerivedSources.make (241047 => 241048)
--- trunk/Source/WebCore/DerivedSources.make 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/DerivedSources.make 2019-02-06 21:52:57 UTC (rev 241048)
@@ -374,7 +374,12 @@
$(WebCore)/Modules/webgpu/DOMWindowWebGPU.idl \
$(WebCore)/Modules/webgpu/GPUCompareFunction.idl \
$(WebCore)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl \
+ $(WebCore)/Modules/webgpu/GPUExtent3D.idl \
$(WebCore)/Modules/webgpu/GPURequestAdapterOptions.idl \
+ $(WebCore)/Modules/webgpu/GPUTextureDescriptor.idl \
+ $(WebCore)/Modules/webgpu/GPUTextureDimension.idl \
+ $(WebCore)/Modules/webgpu/GPUTextureFormat.idl \
+ $(WebCore)/Modules/webgpu/GPUTextureUsage.idl \
$(WebCore)/Modules/webgpu/WebGPU.idl \
$(WebCore)/Modules/webgpu/WebGPUAdapter.idl \
$(WebCore)/Modules/webgpu/WebGPUBindGroup.idl \
@@ -410,7 +415,6 @@
$(WebCore)/Modules/webgpu/WebGPUShaderStageBit.idl \
$(WebCore)/Modules/webgpu/WebGPUSwapChain.idl \
$(WebCore)/Modules/webgpu/WebGPUTexture.idl \
- $(WebCore)/Modules/webgpu/WebGPUTextureFormatEnum.idl \
$(WebCore)/Modules/webgpu/WebGPUTextureView.idl \
$(WebCore)/Modules/webgpu/WebGPUVertexAttributeDescriptor.idl \
$(WebCore)/Modules/webgpu/WebGPUVertexFormat.idl \
Copied: trunk/Source/WebCore/Modules/webgpu/GPUExtent3D.idl (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl) (0 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/GPUExtent3D.idl (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUExtent3D.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -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;
+
+[
+ Conditional=WEBGPU,
+ EnabledAtRuntime=WebGPU
+] dictionary GPUExtent3D {
+ u32 width;
+ u32 height;
+ u32 depth;
+};
Copied: trunk/Source/WebCore/Modules/webgpu/GPUTextureDescriptor.idl (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl) (0 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/GPUTextureDescriptor.idl (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUTextureDescriptor.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,41 @@
+/*
+ * 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 GPUTextureUsageFlags;
+
+[
+ Conditional=WEBGPU,
+ EnabledAtRuntime=WebGPU
+] dictionary GPUTextureDescriptor {
+ GPUExtent3D size;
+ u32 arrayLayerCount;
+ u32 mipLevelCount;
+ u32 sampleCount;
+ GPUTextureDimension dimension;
+ GPUTextureFormat format;
+ GPUTextureUsageFlags usage;
+};
Copied: trunk/Source/WebCore/Modules/webgpu/GPUTextureDimension.idl (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl) (0 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/GPUTextureDimension.idl (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUTextureDimension.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,34 @@
+/*
+ * 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
+
+[
+ Conditional=WEBGPU,
+ EnabledAtRuntime=WebGPU
+] enum GPUTextureDimension {
+ "1d",
+ "2d",
+ "3d"
+};
Copied: trunk/Source/WebCore/Modules/webgpu/GPUTextureFormat.idl (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl) (0 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/GPUTextureFormat.idl (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUTextureFormat.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+[
+ Conditional=WEBGPU,
+ EnabledAtRuntime=WebGPU
+] enum GPUTextureFormat {
+ "r8g8b8a8-unorm",
+ "r8g8b8a8-uint",
+ "b8g8r8a8-unorm",
+ "d32-float-s8-uint"
+};
Copied: trunk/Source/WebCore/Modules/webgpu/GPUTextureUsage.idl (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.idl) (0 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/GPUTextureUsage.idl (rev 0)
+++ trunk/Source/WebCore/Modules/webgpu/GPUTextureUsage.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,41 @@
+/*
+ * 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 GPUTextureUsage {
+ const u32 NONE = 0;
+ const u32 TRANSFER_SRC = 1;
+ const u32 TRANSFER_DST = 2;
+ const u32 SAMPLED = 4;
+ const u32 STORAGE = 8;
+ const u32 OUTPUT_ATTACHMENT = 16;
+};
Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.cpp (241047 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.cpp 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.cpp 2019-02-06 21:52:57 UTC (rev 241048)
@@ -28,7 +28,7 @@
#if ENABLE(WEBGPU)
-#include "GPUTextureFormatEnum.h"
+#include "GPUTextureFormat.h"
namespace WebCore {
Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.h (241047 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.h 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -29,9 +29,9 @@
#include "GPUBasedCanvasRenderingContext.h"
#include "GPUSwapChain.h"
+#include "GPUTextureFormat.h"
#include "WebGPUDevice.h"
#include "WebGPUTexture.h"
-#include "WebGPUTextureFormatEnum.h"
#include <wtf/RefPtr.h>
@@ -42,7 +42,7 @@
struct Descriptor {
const WebGPUDevice* device = nullptr;
// FIXME: More texture properties.
- WebGPUTextureFormatEnum format;
+ GPUTextureFormat format;
unsigned long width;
unsigned long height;
};
Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.idl (241047 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.idl 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUSwapChain.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -42,7 +42,7 @@
] dictionary WebGPUSwapChainDescriptor {
WebGPUDevice? device;
// WebGPUTextureUsageFlags usage;
- WebGPUTextureFormatEnum format;
+ GPUTextureFormat format;
u32 width;
u32 height;
};
Deleted: trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h (241047 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -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 "GPUTextureFormatEnum.h"
-
-namespace WebCore {
-
-using WebGPUTextureFormatEnum = GPUTextureFormatEnum;
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGPU)
Deleted: trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl (241047 => 241048)
--- trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.idl 2019-02-06 21:52:57 UTC (rev 241048)
@@ -1,34 +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.
- */
-
-[
- Conditional=WEBGPU,
- EnabledAtRuntime=WebGPU
-] enum WebGPUTextureFormatEnum {
- "R8G8B8A8Unorm",
- "R8G8B8A8Uint",
- "B8G8R8A8Unorm",
- "D32FloatS8Uint"
-};
Modified: trunk/Source/WebCore/Sources.txt (241047 => 241048)
--- trunk/Source/WebCore/Sources.txt 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/Sources.txt 2019-02-06 21:52:57 UTC (rev 241048)
@@ -2765,6 +2765,12 @@
JSFontFaceSet.cpp
JSGPUCompareFunction.cpp
JSGPUDepthStencilStateDescriptor.cpp
+JSGPUExtent3D.cpp
+JSGPURequestAdapterOptions.cpp
+JSGPUTextureDescriptor.cpp
+JSGPUTextureDimension.cpp
+JSGPUTextureFormat.cpp
+JSGPUTextureUsage.cpp
JSGainNode.cpp
JSGeolocation.cpp
JSGeoposition.cpp
@@ -2771,7 +2777,6 @@
JSGlobalCrypto.cpp
JSGlobalEventHandlers.cpp
JSGlobalPerformance.cpp
-JSGPURequestAdapterOptions.cpp
JSHTMLAllCollection.cpp
JSHTMLAnchorElement.cpp
JSHTMLAppletElement.cpp
@@ -3329,7 +3334,6 @@
JSWebGPUShaderStageBit.cpp
JSWebGPUSwapChain.cpp
JSWebGPUTexture.cpp
-JSWebGPUTextureFormatEnum.cpp
JSWebGPUTextureView.cpp
JSWebGPUVertexAttributeDescriptor.cpp
JSWebGPUVertexFormat.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (241047 => 241048)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-02-06 21:52:57 UTC (rev 241048)
@@ -921,7 +921,7 @@
312FF91921A4C36500EB199D /* GPUShaderModuleDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF8C021A4C2F200EB199D /* GPUShaderModuleDescriptor.h */; };
312FF91A21A4C36500EB199D /* GPUSwapChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF8BA21A4C2EF00EB199D /* GPUSwapChain.h */; };
312FF91B21A4C36500EB199D /* GPUTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF8C521A4C2F400EB199D /* GPUTexture.h */; };
- 312FF91C21A4C36500EB199D /* GPUTextureFormatEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF8C321A4C2F300EB199D /* GPUTextureFormatEnum.h */; };
+ 312FF91C21A4C36500EB199D /* GPUTextureFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF8C321A4C2F300EB199D /* GPUTextureFormat.h */; };
312FF91D21A4C37300EB199D /* GPULegacyRenderPassDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF8FF21A4C33F00EB199D /* GPULegacyRenderPassDescriptor.h */; };
312FF91E21A4C37300EB199D /* GPULegacyBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF90221A4C33F00EB199D /* GPULegacyBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
312FF91F21A4C37300EB199D /* GPULegacyTextureDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 312FF90421A4C33F00EB199D /* GPULegacyTextureDescriptor.h */; };
@@ -6955,7 +6955,7 @@
312FF8C021A4C2F200EB199D /* GPUShaderModuleDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUShaderModuleDescriptor.h; sourceTree = "<group>"; };
312FF8C121A4C2F200EB199D /* GPUQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUQueue.h; sourceTree = "<group>"; };
312FF8C221A4C2F300EB199D /* GPUPipelineStageDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPipelineStageDescriptor.h; sourceTree = "<group>"; };
- 312FF8C321A4C2F300EB199D /* GPUTextureFormatEnum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTextureFormatEnum.h; sourceTree = "<group>"; };
+ 312FF8C321A4C2F300EB199D /* GPUTextureFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTextureFormat.h; sourceTree = "<group>"; };
312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPipelineDescriptorBase.h; sourceTree = "<group>"; };
312FF8C521A4C2F400EB199D /* GPUTexture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTexture.h; sourceTree = "<group>"; };
312FF8CF21A4C33F00EB199D /* GPULegacyTextureDescriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPULegacyTextureDescriptor.cpp; sourceTree = "<group>"; };
@@ -13952,6 +13952,14 @@
D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.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>"; };
+ D026F480220A2B7000AC5F49 /* GPUExtent3D.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUExtent3D.idl; sourceTree = "<group>"; };
+ D026F483220A472F00AC5F49 /* GPUTextureUsage.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUTextureUsage.idl; sourceTree = "<group>"; };
+ D026F485220A477200AC5F49 /* GPUTextureUsage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTextureUsage.h; sourceTree = "<group>"; };
+ D026F486220A505900AC5F49 /* GPUTextureDimension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTextureDimension.h; sourceTree = "<group>"; };
+ D026F489220A539800AC5F49 /* GPUTextureDimension.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUTextureDimension.idl; sourceTree = "<group>"; };
+ D026F48B220A5B0B00AC5F49 /* GPUTextureDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUTextureDescriptor.idl; sourceTree = "<group>"; };
+ D026F48C220A5BAD00AC5F49 /* GPUTextureDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTextureDescriptor.h; sourceTree = "<group>"; };
D02B83ED21C8397A00F85473 /* WebGPUBindGroupLayoutDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBindGroupLayoutDescriptor.idl; sourceTree = "<group>"; };
D02C26922181416D00D818E4 /* GPURequestAdapterOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPURequestAdapterOptions.idl; sourceTree = "<group>"; };
D02F854E21682A4A0088EE74 /* WebMetalCommandQueue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebMetalCommandQueue.idl; sourceTree = "<group>"; };
@@ -14149,8 +14157,7 @@
D0EACF9121940A5B000FA75C /* WebGPUProgrammablePassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUProgrammablePassEncoder.h; sourceTree = "<group>"; };
D0EACF9221940A5B000FA75C /* WebGPUProgrammablePassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUProgrammablePassEncoder.cpp; sourceTree = "<group>"; };
D0EACF9321940A5B000FA75C /* WebGPUProgrammablePassEncoder.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUProgrammablePassEncoder.idl; sourceTree = "<group>"; };
- D0EACFAD219E30FD000FA75C /* WebGPUTextureFormatEnum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUTextureFormatEnum.h; sourceTree = "<group>"; };
- D0EACFAE219E30FD000FA75C /* WebGPUTextureFormatEnum.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUTextureFormatEnum.idl; sourceTree = "<group>"; };
+ D0EACFAE219E30FD000FA75C /* GPUTextureFormat.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUTextureFormat.idl; sourceTree = "<group>"; };
D0EDA772143E303C0028E383 /* CachedRawResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedRawResource.cpp; sourceTree = "<group>"; };
D0EDA773143E303C0028E383 /* CachedRawResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedRawResource.h; sourceTree = "<group>"; };
D0F75598220391C300118058 /* WHLSLVertexBufferIndexCalculator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLVertexBufferIndexCalculator.h; sourceTree = "<group>"; };
@@ -18459,6 +18466,7 @@
D03C849A21FFC6670002227F /* GPUDepthStencilStateDescriptor.h */,
312FF8BF21A4C2F100EB199D /* GPUDevice.cpp */,
312FF8BE21A4C2F100EB199D /* GPUDevice.h */,
+ D026F47D220A2AC600AC5F49 /* GPUExtent3D.h */,
D0D8649921BA1B1F003C983C /* GPUInputStateDescriptor.h */,
D0F7559F2203BA1400118058 /* GPULimits.h */,
312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */,
@@ -18478,7 +18486,10 @@
312FF8C021A4C2F200EB199D /* GPUShaderModuleDescriptor.h */,
312FF8BA21A4C2EF00EB199D /* GPUSwapChain.h */,
312FF8C521A4C2F400EB199D /* GPUTexture.h */,
- 312FF8C321A4C2F300EB199D /* GPUTextureFormatEnum.h */,
+ D026F48C220A5BAD00AC5F49 /* GPUTextureDescriptor.h */,
+ D026F486220A505900AC5F49 /* GPUTextureDimension.h */,
+ 312FF8C321A4C2F300EB199D /* GPUTextureFormat.h */,
+ D026F485220A477200AC5F49 /* GPUTextureUsage.h */,
D0D8649B21BA1C2D003C983C /* GPUVertexAttributeDescriptor.h */,
D0D8649C21BA1CE8003C983C /* GPUVertexInputDescriptor.h */,
498770D71242C535002226BA /* Texture.cpp */,
@@ -26045,7 +26056,12 @@
D00F5942216ECC7A000D71DB /* DOMWindowWebGPU.idl */,
D03C849E21FFCF000002227F /* GPUCompareFunction.idl */,
D03C84A221FFD7230002227F /* GPUDepthStencilStateDescriptor.idl */,
+ D026F480220A2B7000AC5F49 /* GPUExtent3D.idl */,
D02C26922181416D00D818E4 /* GPURequestAdapterOptions.idl */,
+ D026F48B220A5B0B00AC5F49 /* GPUTextureDescriptor.idl */,
+ D026F489220A539800AC5F49 /* GPUTextureDimension.idl */,
+ D0EACFAE219E30FD000FA75C /* GPUTextureFormat.idl */,
+ D026F483220A472F00AC5F49 /* GPUTextureUsage.idl */,
D00F5947216EFE54000D71DB /* WebGPU.cpp */,
D00F5946216EFE54000D71DB /* WebGPU.h */,
D00F5948216EFE54000D71DB /* WebGPU.idl */,
@@ -26132,8 +26148,6 @@
D0EACF852193B02E000FA75C /* WebGPUTexture.cpp */,
D0EACF842193B02E000FA75C /* WebGPUTexture.h */,
D0EACF862193B02E000FA75C /* WebGPUTexture.idl */,
- D0EACFAD219E30FD000FA75C /* WebGPUTextureFormatEnum.h */,
- D0EACFAE219E30FD000FA75C /* WebGPUTextureFormatEnum.idl */,
D0EACF882193EE4E000FA75C /* WebGPUTextureView.cpp */,
D0EACF872193EE4E000FA75C /* WebGPUTextureView.h */,
D0EACF892193EE4E000FA75C /* WebGPUTextureView.idl */,
@@ -29360,7 +29374,7 @@
312FF91921A4C36500EB199D /* GPUShaderModuleDescriptor.h in Headers */,
312FF91A21A4C36500EB199D /* GPUSwapChain.h in Headers */,
312FF91B21A4C36500EB199D /* GPUTexture.h in Headers */,
- 312FF91C21A4C36500EB199D /* GPUTextureFormatEnum.h in Headers */,
+ 312FF91C21A4C36500EB199D /* GPUTextureFormat.h in Headers */,
BC53C5F50DA56B920021EB5D /* Gradient.h in Headers */,
B22279640D00BF220071B782 /* GradientAttributes.h in Headers */,
2D481F04146B5C6B00AA7834 /* GradientImage.h in Headers */,
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (241047 => 241048)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -81,6 +81,7 @@
macro(Gamepad) \
macro(GamepadButton) \
macro(GamepadEvent) \
+ macro(GPUTextureUsage) \
macro(HTMLAttachmentElement) \
macro(HTMLAudioElement) \
macro(HTMLDataListElement) \
Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUExtent3D.h (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h) (0 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUExtent3D.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUExtent3D.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,40 @@
+/*
+ * 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)
+
+namespace WebCore {
+
+struct GPUExtent3D {
+ unsigned long width;
+ unsigned long height;
+ unsigned long depth;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)
Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h (241047 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -39,7 +39,7 @@
class GPUDevice;
-enum class GPUTextureFormatEnum;
+enum class GPUTextureFormat;
using PlatformDrawableSmartPtr = RetainPtr<CAMetalDrawable>;
using PlatformLayer = CALayer;
@@ -50,7 +50,7 @@
static RefPtr<GPUSwapChain> create();
void setDevice(const GPUDevice&);
- void setFormat(GPUTextureFormatEnum);
+ void setFormat(GPUTextureFormat);
void reshape(int width, int height);
RefPtr<GPUTexture> getNextTexture();
void present();
Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h) (0 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,49 @@
+/*
+ * 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 "GPUExtent3D.h"
+#include "GPUTextureDimension.h"
+#include "GPUTextureFormat.h"
+#include "GPUTextureUsage.h"
+
+namespace WebCore {
+
+struct GPUTextureDescriptor {
+ GPUExtent3D size;
+ unsigned long arrayLayerCount;
+ unsigned long mipLevelCount;
+ unsigned long sampleCount;
+ GPUTextureDimension dimension;
+ GPUTextureFormat format;
+ GPUTextureUsageFlags usage;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)
Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDimension.h (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h) (0 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDimension.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDimension.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,40 @@
+/*
+ * 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)
+
+namespace WebCore {
+
+enum class GPUTextureDimension {
+ _1d,
+ _2d,
+ _3d
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)
Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormat.h (from rev 241047, trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormatEnum.h) (0 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormat.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormat.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -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)
+
+namespace WebCore {
+
+enum class GPUTextureFormat {
+ R8g8b8a8Unorm,
+ R8g8b8a8Uint,
+ B8g8r8a8Unorm,
+ D32FloatS8Uint
+};
+
+using PlatformTextureFormat = unsigned long;
+
+}
+
+#endif // ENABLE(WEBGPU)
Deleted: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormatEnum.h (241047 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormatEnum.h 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureFormatEnum.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -1,43 +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)
-
-namespace WebCore {
-
-enum class GPUTextureFormatEnum {
- R8G8B8A8Unorm,
- R8G8B8A8Uint,
- B8G8R8A8Unorm,
- D32FloatS8Uint
-};
-
-using PlatformTextureFormat = unsigned long;
-
-}
-
-#endif // ENABLE(WEBGPU)
Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureUsage.h (from rev 241047, trunk/Source/WebCore/Modules/webgpu/WebGPUTextureFormatEnum.h) (0 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureUsage.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureUsage.h 2019-02-06 21:52:57 UTC (rev 241048)
@@ -0,0 +1,48 @@
+/*
+ * 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 GPUTextureUsageFlags = unsigned long;
+
+class GPUTextureUsage : public RefCounted<GPUTextureUsage> {
+public:
+ static const GPUTextureUsageFlags None = 0;
+ static const GPUTextureUsageFlags TransferSrc = 1;
+ static const GPUTextureUsageFlags TransferDst = 2;
+ static const GPUTextureUsageFlags Sampled = 4;
+ static const GPUTextureUsageFlags Storage = 8;
+ static const GPUTextureUsageFlags OutputAttachment = 16;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGPU)
Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm (241047 => 241048)
--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm 2019-02-06 21:48:01 UTC (rev 241047)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm 2019-02-06 21:52:57 UTC (rev 241048)
@@ -30,7 +30,7 @@
#import "GPUDevice.h"
#import "GPUTexture.h"
-#import "GPUTextureFormatEnum.h"
+#import "GPUTextureFormat.h"
#import "Logging.h"
#import "WebGPULayer.h"
@@ -80,16 +80,16 @@
[m_platformSwapLayer setDevice:device.platformDevice()];
}
-static Optional<PlatformTextureFormat> platformTextureFormatForGPUTextureFormat(GPUTextureFormatEnum format)
+static Optional<PlatformTextureFormat> platformTextureFormatForGPUTextureFormat(GPUTextureFormat format)
{
switch (format) {
- case GPUTextureFormatEnum::R8G8B8A8Unorm:
+ case GPUTextureFormat::R8g8b8a8Unorm:
return MTLPixelFormatRGBA8Unorm;
- case GPUTextureFormatEnum::R8G8B8A8Uint:
+ case GPUTextureFormat::R8g8b8a8Uint:
return MTLPixelFormatRGBA8Uint;
- case GPUTextureFormatEnum::B8G8R8A8Unorm:
+ case GPUTextureFormat::B8g8r8a8Unorm:
return MTLPixelFormatBGRA8Unorm;
- case GPUTextureFormatEnum::D32FloatS8Uint:
+ case GPUTextureFormat::D32FloatS8Uint:
return MTLPixelFormatDepth32Float_Stencil8;
default:
LOG(WebGPU, "GPUSwapChain::setFormat(): Invalid texture format specified!");
@@ -97,7 +97,7 @@
}
}
-void GPUSwapChain::setFormat(GPUTextureFormatEnum format)
+void GPUSwapChain::setFormat(GPUTextureFormat format)
{
auto result = platformTextureFormatForGPUTextureFormat(format);
if (!result)