Added: trunk/Source/WebGPU/CommandLinePlayground/main.swift (0 => 290069)
--- trunk/Source/WebGPU/CommandLinePlayground/main.swift (rev 0)
+++ trunk/Source/WebGPU/CommandLinePlayground/main.swift 2022-02-17 21:32:13 UTC (rev 290069)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2022 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. ``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
+ * 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.
+ */
+
+import Foundation
+import WebGPU
+
+var instanceDescriptor = WGPUInstanceDescriptor(nextInChain: nil)
+let instance = wgpuCreateInstance(&instanceDescriptor)
+defer {
+ wgpuInstanceRelease(instance)
+}
+
+let _ = WGPUTextureDescriptorViewFormats(chain: WGPUChainedStruct(next: nil, sType: WGPUSType(rawValue: WGPUSTypeExtended_TextureDescriptorViewFormats.rawValue)), viewFormatsCount: 0, viewFormats: nil)
+
+print("Done.")
Added: trunk/Source/WebGPU/Configurations/CommandLinePlayground.xcconfig (0 => 290069)
--- trunk/Source/WebGPU/Configurations/CommandLinePlayground.xcconfig (rev 0)
+++ trunk/Source/WebGPU/Configurations/CommandLinePlayground.xcconfig 2022-02-17 21:32:13 UTC (rev 290069)
@@ -0,0 +1,25 @@
+// Copyright (C) 2014-2022 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. ``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
+// 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.
+
+PRODUCT_NAME = CommandLinePlayground;
+SWIFT_VERSION = 5.0;
Modified: trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj (290068 => 290069)
--- trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj 2022-02-17 21:31:24 UTC (rev 290068)
+++ trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj 2022-02-17 21:32:13 UTC (rev 290069)
@@ -11,6 +11,8 @@
1C023D4027449070001DB734 /* libwgsl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CEBD7F22716B2CC00A5254D /* libwgsl.a */; };
1C023D4B274495B9001DB734 /* _javascript_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C023D4A274495B9001DB734 /* _javascript_Core.framework */; };
1C2CEDEE271E8A7300EDC16F /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C2CEDED271E8A7300EDC16F /* Metal.framework */; };
+ 1C5319C027BDC6CC00CD127E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C5319BF27BDC6CC00CD127E /* main.swift */; };
+ 1C5319C527BDC72700CD127E /* WebGPU.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CEBD7E32716AFBA00A5254D /* WebGPU.framework */; };
1C5ACA94273A41C20095F8D5 /* Instance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C5ACA92273A41C20095F8D5 /* Instance.mm */; };
1C5ACAB6273A426D0095F8D5 /* RenderPipeline.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C5ACA98273A426D0095F8D5 /* RenderPipeline.mm */; };
1C5ACABB273A426D0095F8D5 /* Buffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C5ACA9D273A426D0095F8D5 /* Buffer.mm */; };
@@ -56,6 +58,13 @@
remoteGlobalIDString = 1CEBD7F12716B2CC00A5254D;
remoteInfo = WGSL;
};
+ 1C5319C727BDC72700CD127E /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 1CEBD7DA2716AFBA00A5254D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 1CEBD7E22716AFBA00A5254D;
+ remoteInfo = WebGPU;
+ };
1CEBD8272716CACC00A5254D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1CEBD7DA2716AFBA00A5254D /* Project object */;
@@ -65,6 +74,18 @@
};
/* End PBXContainerItemProxy section */
+/* Begin PBXCopyFilesBuildPhase section */
+ 1C5319BB27BDC6CB00CD127E /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
/* Begin PBXFileReference section */
1C023D3C27449070001DB734 /* WGSLUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WGSLUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1C023D3E27449070001DB734 /* WGSLLexerTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WGSLLexerTests.mm; sourceTree = "<group>"; };
@@ -71,6 +92,9 @@
1C023D472744916D001DB734 /* WGSLUnitTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WGSLUnitTests.xcconfig; sourceTree = "<group>"; };
1C023D4A274495B9001DB734 /* _javascript_Core.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = _javascript_Core.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1C2CEDED271E8A7300EDC16F /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
+ 1C5319BD27BDC6CB00CD127E /* CommandLinePlayground */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CommandLinePlayground; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1C5319BF27BDC6CC00CD127E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
+ 1C5319CA27BDD70000CD127E /* CommandLinePlayground.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CommandLinePlayground.xcconfig; sourceTree = "<group>"; };
1C5ACA92273A41C20095F8D5 /* Instance.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Instance.mm; sourceTree = "<group>"; };
1C5ACA96273A426D0095F8D5 /* Surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Surface.h; sourceTree = "<group>"; };
1C5ACA97273A426D0095F8D5 /* SwapChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwapChain.h; sourceTree = "<group>"; };
@@ -157,6 +181,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 1C5319BA27BDC6CB00CD127E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C5319C527BDC72700CD127E /* WebGPU.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1CEBD7E02716AFBA00A5254D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -185,6 +217,14 @@
path = WGSLUnitTests;
sourceTree = "<group>";
};
+ 1C5319BE27BDC6CB00CD127E /* CommandLinePlayground */ = {
+ isa = PBXGroup;
+ children = (
+ 1C5319BF27BDC6CC00CD127E /* main.swift */,
+ );
+ path = CommandLinePlayground;
+ sourceTree = "<group>";
+ };
1CEBD7D92716AFBA00A5254D = {
isa = PBXGroup;
children = (
@@ -193,6 +233,7 @@
1CEBD7F62716B33100A5254D /* WGSL */,
1CEBD7E52716AFBA00A5254D /* WebGPU */,
1C023D3D27449070001DB734 /* WGSLUnitTests */,
+ 1C5319BE27BDC6CB00CD127E /* CommandLinePlayground */,
1CEBD7E42716AFBA00A5254D /* Products */,
1CEBD8252716CACC00A5254D /* Frameworks */,
);
@@ -201,6 +242,7 @@
1CEBD7E42716AFBA00A5254D /* Products */ = {
isa = PBXGroup;
children = (
+ 1C5319BD27BDC6CB00CD127E /* CommandLinePlayground */,
1CEBD7F22716B2CC00A5254D /* libwgsl.a */,
1CEBD7E32716AFBA00A5254D /* WebGPU.framework */,
1C023D3C27449070001DB734 /* WGSLUnitTests.xctest */,
@@ -271,13 +313,13 @@
children = (
1CEBD8072716C2C000A5254D /* AST.h */,
1CEBD8042716BFAB00A5254D /* config.h */,
+ 338BB2D527B6B68700E066AB /* Lexer.cpp */,
338BB2D327B6B66C00E066AB /* Lexer.h */,
- 338BB2D527B6B68700E066AB /* Lexer.cpp */,
338BB2D127B6B63F00E066AB /* SourceSpan.h */,
+ 338BB2CF27B6B61B00E066AB /* Token.cpp */,
338BB2CD27B6B60200E066AB /* Token.h */,
- 338BB2CF27B6B61B00E066AB /* Token.cpp */,
+ 1CEBD8022716BF8200A5254D /* WGSL.cpp */,
1CEBD7F72716B34400A5254D /* WGSL.h */,
- 1CEBD8022716BF8200A5254D /* WGSL.cpp */,
);
path = WGSL;
sourceTree = "<group>";
@@ -286,6 +328,7 @@
isa = PBXGroup;
children = (
1CEBD7FA2716B3D500A5254D /* Base.xcconfig */,
+ 1C5319CA27BDD70000CD127E /* CommandLinePlayground.xcconfig */,
1CEBD7FB2716B5B400A5254D /* DebugRelease.xcconfig */,
1CEBD8012716B9AB00A5254D /* SDKVariant.xcconfig */,
1CC0C8CA273A819100D0B481 /* Version.xcconfig */,
@@ -327,8 +370,8 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
+ 338BB2D427B6B66C00E066AB /* Lexer.h in Headers */,
338BB2D227B6B63F00E066AB /* SourceSpan.h in Headers */,
- 338BB2D427B6B66C00E066AB /* Lexer.h in Headers */,
338BB2CE27B6B60200E066AB /* Token.h in Headers */,
1CEBD7F82716B34400A5254D /* WGSL.h in Headers */,
);
@@ -355,6 +398,24 @@
productReference = 1C023D3C27449070001DB734 /* WGSLUnitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
+ 1C5319BC27BDC6CB00CD127E /* CommandLinePlayground */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1C5319C427BDC6CC00CD127E /* Build configuration list for PBXNativeTarget "CommandLinePlayground" */;
+ buildPhases = (
+ 1C5319B927BDC6CB00CD127E /* Sources */,
+ 1C5319BA27BDC6CB00CD127E /* Frameworks */,
+ 1C5319BB27BDC6CB00CD127E /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 1C5319C827BDC72700CD127E /* PBXTargetDependency */,
+ );
+ name = CommandLinePlayground;
+ productName = CommandLinePlayground;
+ productReference = 1C5319BD27BDC6CB00CD127E /* CommandLinePlayground */;
+ productType = "com.apple.product-type.tool";
+ };
1CEBD7E22716AFBA00A5254D /* WebGPU */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1CEBD7EA2716AFBA00A5254D /* Build configuration list for PBXNativeTarget "WebGPU" */;
@@ -399,11 +460,16 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = NO;
+ DefaultBuildSystemTypeForWorkspace = Original;
+ LastSwiftUpdateCheck = 1400;
LastUpgradeCheck = 1330;
TargetAttributes = {
1C023D3B27449070001DB734 = {
CreatedOnToolsVersion = 13.3;
};
+ 1C5319BC27BDC6CB00CD127E = {
+ CreatedOnToolsVersion = 14.0;
+ };
1CEBD7E22716AFBA00A5254D = {
CreatedOnToolsVersion = 13.3;
};
@@ -428,6 +494,7 @@
1CEBD7E22716AFBA00A5254D /* WebGPU */,
1CEBD7F12716B2CC00A5254D /* WGSL */,
1C023D3B27449070001DB734 /* WGSLUnitTests */,
+ 1C5319BC27BDC6CB00CD127E /* CommandLinePlayground */,
);
};
/* End PBXProject section */
@@ -480,6 +547,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 1C5319B927BDC6CB00CD127E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C5319C027BDC6CC00CD127E /* main.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1CEBD7DF2716AFBA00A5254D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -515,8 +590,8 @@
buildActionMask = 2147483647;
files = (
338BB2D627B6B68700E066AB /* Lexer.cpp in Sources */,
+ 338BB2D027B6B61B00E066AB /* Token.cpp in Sources */,
1CEBD8032716BF8200A5254D /* WGSL.cpp in Sources */,
- 338BB2D027B6B61B00E066AB /* Token.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -528,6 +603,11 @@
target = 1CEBD7F12716B2CC00A5254D /* WGSL */;
targetProxy = 1C023D4127449070001DB734 /* PBXContainerItemProxy */;
};
+ 1C5319C827BDC72700CD127E /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 1CEBD7E22716AFBA00A5254D /* WebGPU */;
+ targetProxy = 1C5319C727BDC72700CD127E /* PBXContainerItemProxy */;
+ };
1CEBD8282716CACC00A5254D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1CEBD7F12716B2CC00A5254D /* WGSL */;
@@ -557,6 +637,27 @@
};
name = Production;
};
+ 1C5319C127BDC6CC00CD127E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C5319CA27BDD70000CD127E /* CommandLinePlayground.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 1C5319C227BDC6CC00CD127E /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C5319CA27BDD70000CD127E /* CommandLinePlayground.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ 1C5319C327BDC6CC00CD127E /* Production */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 1C5319CA27BDD70000CD127E /* CommandLinePlayground.xcconfig */;
+ buildSettings = {
+ };
+ name = Production;
+ };
1CEBD7E82716AFBA00A5254D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1CEBD7FB2716B5B400A5254D /* DebugRelease.xcconfig */;
@@ -633,6 +734,16 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Production;
};
+ 1C5319C427BDC6CC00CD127E /* Build configuration list for PBXNativeTarget "CommandLinePlayground" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1C5319C127BDC6CC00CD127E /* Debug */,
+ 1C5319C227BDC6CC00CD127E /* Release */,
+ 1C5319C327BDC6CC00CD127E /* Production */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Production;
+ };
1CEBD7DD2716AFBA00A5254D /* Build configuration list for PBXProject "WebGPU" */ = {
isa = XCConfigurationList;
buildConfigurations = (