Implement timeline fences in Dawn
This change implements timeline fences in Dawn.
It includes methods and descriptor members to eventually
support multi-queue, but does not implement them.
Bug: dawn:26
Change-Id: I81d5fee6acef402fe099227a034d9669a89ab6c3
Reviewed-on: https://dawn-review.googlesource.com/c/2460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/dawn.json b/dawn.json
index b43a7fe..7f6a255 100644
--- a/dawn.json
+++ b/dawn.json
@@ -482,6 +482,13 @@
"returns": "depth stencil state builder"
},
{
+ "name": "create fence",
+ "returns": "fence",
+ "args": [
+ {"name": "descriptor", "type": "fence descriptor", "annotation": "const*"}
+ ]
+ },
+ {
"name": "create render pass descriptor builder",
"returns": "render pass descriptor builder"
},
@@ -609,6 +616,42 @@
{"value": 3, "name": "both"}
]
},
+ "fence": {
+ "category": "object",
+ "methods": [
+ {
+ "name": "get completed value",
+ "returns": "uint64_t"
+ },
+ {
+ "name": "on completion",
+ "args": [
+ {"name": "value", "type": "uint64_t"},
+ {"name": "callback", "type": "fence on completion callback"},
+ {"name": "userdata", "type": "callback userdata"}
+ ]
+ }
+ ]
+ },
+ "fence on completion callback": {
+ "category": "natively defined"
+ },
+ "fence completion status": {
+ "category": "enum",
+ "values": [
+ {"value": 0, "name": "success"},
+ {"value": 1, "name": "error"},
+ {"value": 2, "name": "unknown"},
+ {"value": 3, "name": "context lost"}
+ ]
+ },
+ "fence descriptor": {
+ "category": "structure",
+ "extensible": true,
+ "members": [
+ {"name": "initial value", "type": "uint64_t"}
+ ]
+ },
"filter mode": {
"category": "enum",
"values": [
@@ -707,6 +750,13 @@
{"name": "num commands", "type": "uint32_t"},
{"name": "commands", "type": "command buffer", "annotation": "const*", "length": "num commands"}
]
+ },
+ {
+ "name": "signal",
+ "args": [
+ {"name": "fence", "type": "fence"},
+ {"name": "signal value", "type": "uint64_t"}
+ ]
}
]
},