Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd696d95

Browse files
committed
filter out dawn types and temporary fix for callback types
1 parentb30d76d commitd696d95

File tree

6 files changed

+34
-3
lines changed

6 files changed

+34
-3
lines changed

‎Sources/generate-webgpu/Decoding/DawnData.swift‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ enum Category: String, Decodable {
1313
case constant
1414
case function
1515
case functionPointer="function pointer"
16+
case callbackFunction="callback function"
17+
case callbackInfo="callback info"
1618
}
1719

1820
enumLength:Equatable{
@@ -185,6 +187,18 @@ struct FunctionTypeData: TypeData, Decodable {
185187
@DefaultFallbackvarargs:RecordData
186188
}
187189

190+
structCallbackFunctionTypeData:TypeData,Decodable{
191+
varcategory:Category
192+
@DefaultFallbackvartags:Set<String>
193+
@DefaultFallbackvarargs:RecordData
194+
}
195+
196+
structCallbackInfoTypeData:TypeData,Decodable{
197+
varcategory:Category
198+
@DefaultFallbackvartags:Set<String>
199+
varmembers:RecordData
200+
}
201+
188202

189203
// MARK: Dawn Data
190204

@@ -216,6 +230,10 @@ struct DawnData: Decodable {
216230
types[key]=try container.decode(ConstantTypeData.self, forKey: key)
217231
case.function,.functionPointer:
218232
types[key]=try container.decode(FunctionTypeData.self, forKey: key)
233+
case.callbackFunction:
234+
types[key]=try container.decode(CallbackFunctionTypeData.self, forKey: key)
235+
case.callbackInfo:
236+
types[key]=try container.decode(CallbackInfoTypeData.self, forKey: key)
219237
}
220238
}
221239

‎Sources/generate-webgpu/Decoding/Taggable.swift‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ extension Taggable {
88
returntrue
99
}
1010
// TODO: This could be configurable
11-
return !tags.isDisjoint(with:["dawn","native","deprecated"])
11+
return tags.isSubset(of:["native","deprecated"])
12+
}
13+
14+
varisUpstream:Bool{
15+
return tags.contains("upstream")
1216
}
1317

1418
varisDeprecated:Bool{

‎Sources/generate-webgpu/Model/Model.swift‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ struct Model {
2121
types[name]=FunctionPointerType(name: name, data: data)
2222
}elseif data.category==.function,let data= dataas?FunctionTypeData{
2323
types[name]=FunctionType(name: name, data: data)
24+
}else{
25+
types[name]=NonconvertibleType(name: name, data: data)
2426
}
2527
}
2628

‎Sources/generate-webgpu/Model/ObjectType.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ObjectType: Type {
1919
letmethods:[Method]
2020

2121
init(name:String, data:ObjectTypeData){
22-
methods= data.methods.filter{ $0.isEnabled}.map{Method(data: $0, objectName: name)}
22+
methods= data.methods.map{Method(data: $0, objectName: name)}.filter{ $0.isEnabled}
2323
super.init(name: name, data: data)
2424
}
2525

‎Sources/generate-webgpu/Model/StructureType.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class StructureType: Type {
66
init(name:String, data:StructureTypeData){
77
extensible= data.extensible
88
chained= data.chained
9-
members=Record(data: data.members.filter{ $0.isEnabled}, context:.structure)
9+
members=Record(data: data.members.filter{!$0.isUpstream}, context:.structure)
1010
super.init(name: name, data: data)
1111
}
1212

‎Sources/generate-webgpu/Model/Type.swift‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ class Type: Taggable {
2323
returnString(describing: value)
2424
}
2525
}
26+
27+
28+
classNonconvertibleType:Type{
29+
overridevarswiftName:String{
30+
return cName
31+
}
32+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp