Update dawn.json to more closely match webgpu.h
- Move wgpu::TextureUsage::Storage at the end of the enum.
- Reorder some methods of device to be in alphabetical order.
- Reorder members of wgpu::QuerySetDescriptor.
- Change SurfaceDescriptorFromHTMLCanvasID to
SurfaceDescriptorFromCanvasHTMLDescriptor.
Bug: dawn:22
Change-Id: Ib18fbaf153ad2969b0d0c4e49682e8736b00776c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/dawn.json b/dawn.json
index bd4b5b2..69eb5b4 100644
--- a/dawn.json
+++ b/dawn.json
@@ -117,9 +117,9 @@
{"value": 3, "name": "sampler"},
{"value": 4, "name": "comparison sampler"},
{"value": 5, "name": "sampled texture"},
- {"value": 6, "name": "storage texture"},
- {"value": 7, "name": "readonly storage texture"},
- {"value": 8, "name": "writeonly storage texture"}
+ {"value": 6, "name": "readonly storage texture"},
+ {"value": 7, "name": "writeonly storage texture"},
+ {"value": 8, "name": "storage texture"}
]
},
"blend descriptor": {
@@ -570,13 +570,6 @@
]
},
{
- "name": "create render pipeline",
- "returns": "render pipeline",
- "args": [
- {"name": "descriptor", "type": "render pipeline descriptor", "annotation": "const*"}
- ]
- },
- {
"name": "create pipeline layout",
"returns": "pipeline layout",
"args": [
@@ -584,6 +577,13 @@
]
},
{
+ "name": "create query set",
+ "returns": "query set",
+ "args": [
+ {"name": "descriptor", "type": "query set descriptor", "annotation": "const*"}
+ ]
+ },
+ {
"name": "create render bundle encoder",
"returns": "render bundle encoder",
"args": [
@@ -591,6 +591,13 @@
]
},
{
+ "name": "create render pipeline",
+ "returns": "render pipeline",
+ "args": [
+ {"name": "descriptor", "type": "render pipeline descriptor", "annotation": "const*"}
+ ]
+ },
+ {
"name": "create sampler",
"returns": "sampler",
"args": [
@@ -664,13 +671,6 @@
{"name": "callback", "type": "error callback"},
{"name": "userdata", "type": "void", "annotation": "*"}
]
- },
- {
- "name": "create query set",
- "returns": "query set",
- "args": [
- {"name": "descriptor", "type": "query set descriptor", "annotation": "const*"}
- ]
}
]
},
@@ -940,8 +940,8 @@
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
{"name": "type", "type": "query type"},
{"name": "count", "type": "uint32_t"},
- {"name": "pipeline statistics count", "type": "uint32_t", "default": "0"},
- {"name": "pipeline statistics", "type": "pipeline statistics name", "annotation": "const*", "length": "pipeline statistics count"}
+ {"name": "pipeline statistics", "type": "pipeline statistics name", "annotation": "const*", "length": "pipeline statistics count"},
+ {"name": "pipeline statistics count", "type": "uint32_t", "default": "0"}
]
},
"query type": {
@@ -1418,11 +1418,11 @@
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
]
},
- "surface descriptor from HTML canvas id": {
+ "surface descriptor from canvas HTML selector": {
"category": "structure",
"chained": true,
"members": [
- {"name": "id", "type": "char", "annotation": "const*", "length": "strlen"}
+ {"name": "selector", "type": "char", "annotation": "const*", "length": "strlen"}
]
},
"surface descriptor from metal layer": {
@@ -1488,7 +1488,7 @@
{"value": 1, "name": "surface descriptor from metal layer"},
{"value": 2, "name": "surface descriptor from windows HWND"},
{"value": 3, "name": "surface descriptor from xlib"},
- {"value": 4, "name": "surface descriptor from HTML canvas id"},
+ {"value": 4, "name": "surface descriptor from canvas HTML selector"},
{"value": 5, "name": "shader module SPIRV descriptor"},
{"value": 6, "name": "shader module WGSL descriptor"},
{"value": 7, "name": "sampler descriptor dummy anisotropic filtering"},
diff --git a/src/dawn_native/Surface.cpp b/src/dawn_native/Surface.cpp
index 382bb71..ccd240c 100644
--- a/src/dawn_native/Surface.cpp
+++ b/src/dawn_native/Surface.cpp
@@ -99,7 +99,7 @@
}
#endif // defined(DAWN_USE_X11)
- case wgpu::SType::SurfaceDescriptorFromHTMLCanvasId:
+ case wgpu::SType::SurfaceDescriptorFromCanvasHTMLSelector:
default:
return DAWN_VALIDATION_ERROR("Unsupported sType");
}
diff --git a/src/tests/end2end/WindowSurfaceTests.cpp b/src/tests/end2end/WindowSurfaceTests.cpp
index 7bfc107..8aaa8cc 100644
--- a/src/tests/end2end/WindowSurfaceTests.cpp
+++ b/src/tests/end2end/WindowSurfaceTests.cpp
@@ -115,8 +115,8 @@
// Test that a chained descriptor with HTMLCanvas produces an error.
TEST_F(WindowSurfaceInstanceTests, HTMLCanvasDescriptor) {
- wgpu::SurfaceDescriptorFromHTMLCanvasId chainedDescriptor;
- chainedDescriptor.id = "myCanvas";
+ wgpu::SurfaceDescriptorFromCanvasHTMLSelector chainedDescriptor;
+ chainedDescriptor.selector = "#myCanvas";
wgpu::SurfaceDescriptor descriptor;
descriptor.nextInChain = &chainedDescriptor;