-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
426 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.docc-build/ | ||
.swiftpm/ | ||
.DS_Store | ||
/.build | ||
.build | ||
/Packages | ||
/*.xcodeproj | ||
xcuserdata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
// | ||
// MetalDataType.swift | ||
// Generated on 2022-04-10 15:38:24 +0000 | ||
// | ||
|
||
public enum MetalDataType: UInt8, Hashable, CaseIterable { | ||
case none = 0x00 | ||
case `struct` = 0x01 | ||
case array = 0x02 | ||
case float = 0x03 | ||
case float2 = 0x04 | ||
case float3 = 0x05 | ||
case float4 = 0x06 | ||
case float2x2 = 0x07 | ||
case float2x3 = 0x08 | ||
case float2x4 = 0x09 | ||
case float3x2 = 0x0A | ||
case float3x3 = 0x0B | ||
case float3x4 = 0x0C | ||
case float4x2 = 0x0D | ||
case float4x3 = 0x0E | ||
case float4x4 = 0x0F | ||
case half = 0x10 | ||
case half2 = 0x11 | ||
case half3 = 0x12 | ||
case half4 = 0x13 | ||
case half2x2 = 0x14 | ||
case half2x3 = 0x15 | ||
case half2x4 = 0x16 | ||
case half3x2 = 0x17 | ||
case half3x3 = 0x18 | ||
case half3x4 = 0x19 | ||
case half4x2 = 0x1A | ||
case half4x3 = 0x1B | ||
case half4x4 = 0x1C | ||
case int = 0x1D | ||
case int2 = 0x1E | ||
case int3 = 0x1F | ||
case int4 = 0x20 | ||
case uint = 0x21 | ||
case uint2 = 0x22 | ||
case uint3 = 0x23 | ||
case uint4 = 0x24 | ||
case short = 0x25 | ||
case short2 = 0x26 | ||
case short3 = 0x27 | ||
case short4 = 0x28 | ||
case ushort = 0x29 | ||
case ushort2 = 0x2A | ||
case ushort3 = 0x2B | ||
case ushort4 = 0x2C | ||
case char = 0x2D | ||
case char2 = 0x2E | ||
case char3 = 0x2F | ||
case char4 = 0x30 | ||
case uchar = 0x31 | ||
case uchar2 = 0x32 | ||
case uchar3 = 0x33 | ||
case uchar4 = 0x34 | ||
case bool = 0x35 | ||
case bool2 = 0x36 | ||
case bool3 = 0x37 | ||
case bool4 = 0x38 | ||
case texture = 0x3A | ||
case sampler = 0x3B | ||
case pointer = 0x3C | ||
case r8Unorm = 0x3E | ||
case r8Snorm = 0x3F | ||
case r16Unorm = 0x40 | ||
case r16Snorm = 0x41 | ||
case rg8Unorm = 0x42 | ||
case rg8Snorm = 0x43 | ||
case rg16Unorm = 0x44 | ||
case rg16Snorm = 0x45 | ||
case rgba8Unorm = 0x46 | ||
case rgba8Unorm_sRGB = 0x47 | ||
case rgba8Snorm = 0x48 | ||
case rgba16Unorm = 0x49 | ||
case rgba16Snorm = 0x4A | ||
case rgb10A2Unorm = 0x4B | ||
case rg11B10Float = 0x4C | ||
case rgb9E5Float = 0x4D | ||
case renderPipeline = 0x4E | ||
case computePipeline = 0x4F | ||
case indirectCommandBuffer = 0x50 | ||
case long = 0x51 | ||
case long2 = 0x52 | ||
case long3 = 0x53 | ||
case long4 = 0x54 | ||
case ulong = 0x55 | ||
case ulong2 = 0x56 | ||
case ulong3 = 0x57 | ||
case ulong4 = 0x58 | ||
case double = 0x59 | ||
case double2 = 0x5A | ||
case double3 = 0x5B | ||
case double4 = 0x5C | ||
case float8 = 0x5D | ||
case float16 = 0x5E | ||
case half8 = 0x5F | ||
case half16 = 0x60 | ||
case int8 = 0x61 | ||
case int16 = 0x62 | ||
case uint8 = 0x63 | ||
case uint16 = 0x64 | ||
case short8 = 0x65 | ||
case short16 = 0x66 | ||
case ushort8 = 0x67 | ||
case ushort16 = 0x68 | ||
case char8 = 0x69 | ||
case char16 = 0x6A | ||
case uchar8 = 0x6B | ||
case uchar16 = 0x6C | ||
case long8 = 0x6D | ||
case long16 = 0x6E | ||
case ulong8 = 0x6F | ||
case ulong16 = 0x70 | ||
case double8 = 0x71 | ||
case double16 = 0x72 | ||
case visibleFunctionTable = 0x73 | ||
case intersectionFunctionTable = 0x74 | ||
case primitiveAccelerationStructure = 0x75 | ||
case instanceAccelerationStructure = 0x76 | ||
case bool8 = 0x77 | ||
case bool16 = 0x78 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "swift-argument-parser", | ||
"repositoryURL": "https://github.com/apple/swift-argument-parser", | ||
"state": { | ||
"branch": null, | ||
"revision": "82905286cc3f0fa8adc4674bf49437cab65a8373", | ||
"version": "1.1.1" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// swift-tools-version:5.4 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Utilities", | ||
platforms: [.macOS(.v10_13)], | ||
products: [ | ||
.executable(name: "metal-data-type-tools", targets: ["MetalDataTypeTools"]) | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0") | ||
], | ||
targets: [ | ||
.target(name: "MetalDataTypeInternal"), | ||
.executableTarget( | ||
name: "MetalDataTypeTools", | ||
dependencies: [ | ||
"MetalDataTypeInternal", | ||
.product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
]) | ||
] | ||
) |
13 changes: 13 additions & 0 deletions
13
Utilities/Sources/MetalDataTypeInternal/MetalDataTypeInternal.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// a.m | ||
// | ||
// | ||
// Created by YuAo on 2022/4/10. | ||
// | ||
|
||
#import "MetalDataTypeInternal.h" | ||
|
||
id<MetalDataTypeObject> MetalDataTypeObjectCreate(unsigned long long type) { | ||
id value = [[NSClassFromString(@"MTLTypeInternal") alloc] initWithDataType:type]; | ||
return value; | ||
} |
26 changes: 26 additions & 0 deletions
26
Utilities/Sources/MetalDataTypeInternal/include/MetalDataTypeInternal.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Header.h | ||
// | ||
// | ||
// Created by YuAo on 2022/4/10. | ||
// | ||
|
||
@import Foundation; | ||
@import Metal; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
// MTLTypeInternal | ||
@protocol MetalDataTypeObject | ||
|
||
- (id)initWithDataType:(unsigned long long)arg1; | ||
|
||
@property (nonatomic, readonly) unsigned long long dataType; | ||
|
||
@property (nonatomic, readonly) NSString * description; | ||
|
||
@end | ||
|
||
FOUNDATION_EXPORT id<MetalDataTypeObject> MetalDataTypeObjectCreate(unsigned long long type); | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.