dawn.json changes to match upstream webgpu.h

Bug: dawn:1080
Change-Id: Icc77f8ccd5a07162d0e7795d7160d936f9c33e49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Kai Ninomiya 2021-09-21 17:36:27 +00:00 committed by Dawn LUCI CQ
parent edeb54abf3
commit 7d174a1eff
3 changed files with 66 additions and 6 deletions

View File

@ -22,7 +22,9 @@
"extensible": "in", "extensible": "in",
"tags": ["upstream"], "tags": ["upstream"],
"members": [ "members": [
{"name": "compatible surface", "type": "surface"} {"name": "compatible surface", "type": "surface"},
{"name": "power preference", "type": "power preference", "tags": ["upstream"]},
{"name": "force fallback adapter", "type": "bool", "tags": ["upstream"]}
] ]
}, },
"request adapter status": { "request adapter status": {
@ -50,6 +52,14 @@
"category": "object", "category": "object",
"tags": ["upstream"], "tags": ["upstream"],
"methods": [ "methods": [
{
"name": "get limits",
"returns": "bool",
"tags": ["upstream"],
"args": [
{"name": "limits", "type": "supported limits", "annotation": "*"}
]
},
{ {
"name": "get properties", "name": "get properties",
"tags": ["upstream"], "tags": ["upstream"],
@ -57,6 +67,14 @@
{"name": "properties", "type": "adapter properties", "annotation": "*"} {"name": "properties", "type": "adapter properties", "annotation": "*"}
] ]
}, },
{
"name": "has feature",
"returns": "bool",
"tags": ["upstream"],
"args": [
{"name": "feature", "type": "feature name"}
]
},
{ {
"name": "request device", "name": "request device",
"args": [ "args": [
@ -94,7 +112,11 @@
"extensible": "in", "extensible": "in",
"tags": ["upstream"], "tags": ["upstream"],
"_TODO": "Add requiredFeatures and requiredLimits support", "_TODO": "Add requiredFeatures and requiredLimits support",
"members": [] "members": [
{"name": "required features count", "type": "uint32_t"},
{"name": "required features", "type": "feature name", "annotation": "const*", "length": "required features count"},
{"name": "required limits", "type": "required limits", "annotation": "const*"}
]
}, },
"address mode": { "address mode": {
"category": "enum", "category": "enum",
@ -412,6 +434,14 @@
{"value": 15, "name": "all"} {"value": 15, "name": "all"}
] ]
}, },
"constant entry": {
"category": "structure",
"extensible": "in",
"members": [
{"name": "key", "type": "char", "annotation": "const*"},
{"name": "value", "type": "double"}
]
},
"command buffer": { "command buffer": {
"category": "object" "category": "object"
}, },
@ -524,6 +554,7 @@
}, },
{ {
"name": "write buffer", "name": "write buffer",
"tags": ["dawn"],
"args": [ "args": [
{"name": "buffer", "type": "buffer"}, {"name": "buffer", "type": "buffer"},
{"name": "buffer offset", "type": "uint64_t"}, {"name": "buffer offset", "type": "uint64_t"},
@ -1126,6 +1157,21 @@
{"name": "format", "type": "texture format"} {"name": "format", "type": "texture format"}
] ]
}, },
"feature name": {
"category": "enum",
"tags": ["upstream"],
"values": [
{"value": 0, "name": "undefined", "jsrepr": "undefined"},
{"value": 1, "name": "depth clamping"},
{"value": 2, "name": "depth24 unorm stencil8"},
{"value": 3, "name": "depth32 float stencil8"},
{"value": 4, "name": "timestamp query"},
{"value": 5, "name": "pipeline statistics query"},
{"value": 6, "name": "texture compression BC"},
{"value": 7, "name": "texture compression ETC2"},
{"value": 8, "name": "texture compression ASTC"}
]
},
"filter mode": { "filter mode": {
"category": "enum", "category": "enum",
"values": [ "values": [
@ -1278,6 +1324,14 @@
{"value": 4, "name": "compute shader invocations"} {"value": 4, "name": "compute shader invocations"}
] ]
}, },
"power preference": {
"category": "enum",
"tags": ["upstream"],
"values": [
{"value": 0, "name": "low power"},
{"value": 1, "name": "high performance"}
]
},
"present mode": { "present mode": {
"category": "enum", "category": "enum",
"emscripten_no_enum_table": true, "emscripten_no_enum_table": true,
@ -1292,7 +1346,9 @@
"extensible": "in", "extensible": "in",
"members": [ "members": [
{"name": "module", "type": "shader module"}, {"name": "module", "type": "shader module"},
{"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"} {"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"},
{"name": "constant count", "type": "uint32_t", "tags": ["upstream"]},
{"name": "constants", "type": "constant entry", "annotation": "const*", "length": "constant count", "tags": ["upstream"]}
] ]
}, },
"primitive topology": { "primitive topology": {
@ -1760,6 +1816,8 @@
"members": [ "members": [
{"name": "module", "type": "shader module"}, {"name": "module", "type": "shader module"},
{"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"}, {"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"},
{"name": "constant count", "type": "uint32_t", "tags": ["upstream"]},
{"name": "constants", "type": "constant entry", "annotation": "const*", "length": "constant count", "tags": ["upstream"]},
{"name": "buffer count", "type": "uint32_t", "default": 0}, {"name": "buffer count", "type": "uint32_t", "default": 0},
{"name": "buffers", "type": "vertex buffer layout", "annotation": "const*", "length": "buffer count"} {"name": "buffers", "type": "vertex buffer layout", "annotation": "const*", "length": "buffer count"}
] ]
@ -1817,6 +1875,8 @@
"members": [ "members": [
{"name": "module", "type": "shader module"}, {"name": "module", "type": "shader module"},
{"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"}, {"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"},
{"name": "constant count", "type": "uint32_t", "tags": ["upstream"]},
{"name": "constants", "type": "constant entry", "annotation": "const*", "length": "constant count", "tags": ["upstream"]},
{"name": "target count", "type": "uint32_t"}, {"name": "target count", "type": "uint32_t"},
{"name": "targets", "type": "color target state", "annotation": "const*", "length": "target count"} {"name": "targets", "type": "color target state", "annotation": "const*", "length": "target count"}
] ]

View File

@ -309,7 +309,7 @@ def link_typedef(typedef, types):
# similar to the original order (though the sort isn't technically stable). # similar to the original order (though the sort isn't technically stable).
# #
# It works by computing for each struct type what is the depth of its DAG of # It works by computing for each struct type what is the depth of its DAG of
# dependents, then resorting based on that depth using Python's stable sort. # dependents, then re-sorting based on that depth using Python's stable sort.
# This makes a toposort because if A depends on B then its depth will be bigger # This makes a toposort because if A depends on B then its depth will be bigger
# than B's. It is also nice because all nodes with the same depth are kept in # than B's. It is also nice because all nodes with the same depth are kept in
# the input order. # the input order.

View File

@ -116,9 +116,9 @@ typedef struct WGPUChainedStructOut {
{% for type in by_category["structure"] %} {% for type in by_category["structure"] %}
typedef struct {{as_cType(type.name)}} { typedef struct {{as_cType(type.name)}} {
{% set Out = "Out" if type.output else "" %} {% set Out = "Out" if type.output else "" %}
{% set const = "const" if not type.output else "" %} {% set const = "const " if not type.output else "" %}
{% if type.extensible %} {% if type.extensible %}
WGPUChainedStruct{{Out}} {{const}} * nextInChain; WGPUChainedStruct{{Out}} {{const}}* nextInChain;
{% endif %} {% endif %}
{% if type.chained %} {% if type.chained %}
WGPUChainedStruct{{Out}} chain; WGPUChainedStruct{{Out}} chain;