Add new items for Emscripten/webgpu-headers

Generates the exact upstream headers, except for a few Dawn and upstream
changes that have landed since I started this CL, and the "_TODO"s about
extensibility of compilation info/message.

Bug: dawn:1080
Change-Id: I2a6128a3e78cfef7b9f8feae84b7c7c207eb2826
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62861
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Kai Ninomiya 2021-09-17 21:13:33 +00:00 committed by Dawn LUCI CQ
parent 930e9186a6
commit 4e37accdbb
2 changed files with 129 additions and 8 deletions

136
dawn.json
View File

@ -17,6 +17,56 @@
"_doc": "See docs/codegen.md", "_doc": "See docs/codegen.md",
"request adapter options": {
"category": "structure",
"extensible": true,
"tags": ["upstream"],
"members": [
{"name": "compatible surface", "type": "surface"}
]
},
"request adapter status": {
"category": "enum",
"tags": ["upstream"],
"emscripten_no_enum_table": true,
"values": [
{"value": 0, "name": "success"},
{"value": 1, "name": "unavailable"},
{"value": 2, "name": "error"},
{"value": 3, "name": "unknown"}
]
},
"request adapter callback": {
"category": "callback",
"tags": ["upstream"],
"args": [
{"name": "status", "type": "request adapter status"},
{"name": "adapter", "type": "adapter"},
{"name": "message", "type": "char", "annotation": "const*"},
{"name": "userdata", "type": "void", "annotation": "*"}
]
},
"adapter": {
"category": "object",
"tags": ["upstream"],
"methods": [
{
"name": "get properties",
"tags": ["upstream"],
"args": [
{"name": "properties", "type": "adapter properties", "annotation": "*"}
]
},
{
"name": "request device",
"args": [
{"name": "descriptor", "type": "device descriptor", "annotation": "const*"},
{"name": "callback", "type": "request device callback"},
{"name": "userdata", "type": "void", "annotation": "*"}
]
}
]
},
"adapter properties": { "adapter properties": {
"category": "structure", "category": "structure",
"extensible": true, "extensible": true,
@ -40,6 +90,13 @@
{"value": 3, "name": "unknown"} {"value": 3, "name": "unknown"}
] ]
}, },
"device descriptor": {
"category": "structure",
"extensible": true,
"tags": ["upstream"],
"_TODO": "Add requiredFeatures and requiredLimits support",
"members": []
},
"address mode": { "address mode": {
"category": "enum", "category": "enum",
"values": [ "values": [
@ -53,12 +110,13 @@
"emscripten_no_enum_table": true, "emscripten_no_enum_table": true,
"values": [ "values": [
{"value": 0, "name": "null"}, {"value": 0, "name": "null"},
{"value": 1, "name": "D3D11"}, {"value": 1, "name": "WebGPU"},
{"value": 2, "name": "D3D12"}, {"value": 2, "name": "D3D11"},
{"value": 3, "name": "metal"}, {"value": 3, "name": "D3D12"},
{"value": 4, "name": "vulkan"}, {"value": 4, "name": "metal"},
{"value": 5, "name": "openGL"}, {"value": 5, "name": "vulkan"},
{"value": 6, "name": "openGLES"} {"value": 6, "name": "openGL"},
{"value": 7, "name": "openGLES"}
] ]
}, },
"bind group": { "bind group": {
@ -96,7 +154,7 @@
{"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false}, {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
{"value": 1, "name": "uniform"}, {"value": 1, "name": "uniform"},
{"value": 2, "name": "storage"}, {"value": 2, "name": "storage"},
{"value": 3, "name": "read only storage", "jsrepr": "readonly-storage"} {"value": 3, "name": "read only storage"}
] ]
}, },
"buffer binding layout": { "buffer binding layout": {
@ -498,6 +556,7 @@
"compilation info": { "compilation info": {
"category": "structure", "category": "structure",
"extensible": false, "extensible": false,
"_TODO": "should be extensible, but need to make that work in wire: https://github.com/webgpu-native/webgpu-headers/issues/82",
"members": [ "members": [
{"name": "message count", "type": "uint32_t"}, {"name": "message count", "type": "uint32_t"},
{"name": "messages", "type": "compilation message", "annotation": "const*", "length": "message count"} {"name": "messages", "type": "compilation message", "annotation": "const*", "length": "message count"}
@ -525,6 +584,7 @@
"compilation message": { "compilation message": {
"category": "structure", "category": "structure",
"extensible": false, "extensible": false,
"_TODO": "should be extensible, but need to make that work in wire: https://github.com/webgpu-native/webgpu-headers/issues/82",
"members": [ "members": [
{"name": "message", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}, {"name": "message", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
{"name": "type", "type": "compilation message type"}, {"name": "type", "type": "compilation message type"},
@ -591,6 +651,14 @@
{"name": "query index", "type": "uint32_t"} {"name": "query index", "type": "uint32_t"}
] ]
}, },
{
"name": "begin pipeline statistics query",
"tags": ["upstream"],
"args": [
{"name": "query set", "type": "query set"},
{"name": "query index", "type": "uint32_t"}
]
},
{ {
"name": "dispatch", "name": "dispatch",
"args": [ "args": [
@ -608,6 +676,10 @@
}, },
{ {
"name": "end pass" "name": "end pass"
},
{
"name": "end pipeline statistics query",
"tags": ["upstream"]
} }
] ]
}, },
@ -820,6 +892,11 @@
{"name": "descriptor", "type": "texture descriptor", "annotation": "const*"} {"name": "descriptor", "type": "texture descriptor", "annotation": "const*"}
] ]
}, },
{
"name": "destroy",
"_TODO": "crbug.com/dawn/628: Implement in Dawn",
"tags": ["upstream"]
},
{ {
"name": "get limits", "name": "get limits",
"returns": "bool", "returns": "bool",
@ -892,6 +969,14 @@
{"name": "userdata", "type": "void", "annotation": "*"} {"name": "userdata", "type": "void", "annotation": "*"}
] ]
}, },
"device lost reason": {
"category": "enum",
"emscripten_no_enum_table": true,
"values": [
{"name": "undefined", "value": 0, "jsrepr": "undefined"},
{"name": "destroyed", "value": 1}
]
},
"device properties": { "device properties": {
"category": "structure", "category": "structure",
"extensible": false, "extensible": false,
@ -1086,6 +1171,19 @@
"args": [ "args": [
{"name": "descriptor", "type": "surface descriptor", "annotation": "const*"} {"name": "descriptor", "type": "surface descriptor", "annotation": "const*"}
] ]
},
{
"name": "process events",
"tags": ["upstream"]
},
{
"name": "request adapter",
"tags": ["upstream"],
"args": [
{"name": "options", "type": "request adapter options", "annotation": "const*"},
{"name": "callback", "type": "request adapter callback"},
{"name": "userdata", "type": "void", "annotation": "*"}
]
} }
] ]
}, },
@ -1581,6 +1679,14 @@
{"name": "query index", "type": "uint32_t"} {"name": "query index", "type": "uint32_t"}
] ]
}, },
{
"name": "begin pipeline statistics query",
"tags": ["upstream"],
"args": [
{"name": "query set", "type": "query set"},
{"name": "query index", "type": "uint32_t"}
]
},
{ {
"name": "end occlusion query" "name": "end occlusion query"
}, },
@ -1593,6 +1699,10 @@
}, },
{ {
"name": "end pass" "name": "end pass"
},
{
"name": "end pipeline statistics query",
"tags": ["upstream"]
} }
] ]
}, },
@ -1831,7 +1941,17 @@
] ]
}, },
"surface": { "surface": {
"category": "object" "category": "object",
"methods": [
{
"name": "get preferred format",
"returns": "texture format",
"tags": ["upstream"],
"args": [
{"name": "adapter", "type": "adapter"}
]
}
]
}, },
"surface descriptor": { "surface descriptor": {
"category": "structure", "category": "structure",

View File

@ -76,6 +76,7 @@ namespace dawn_native {
return BackendType::OpenGLES; return BackendType::OpenGLES;
case wgpu::BackendType::D3D11: case wgpu::BackendType::D3D11:
case wgpu::BackendType::WebGPU:
UNREACHABLE(); UNREACHABLE();
} }
} }