Add SurfaceDescriptorFromHTMLCanvasID
Bug:dawn:269 Change-Id: I91802b44d0280224b93eb4fb637e91597bc03c81 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15322 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
parent
8ffd3f2333
commit
c2e16963a9
10
dawn.json
10
dawn.json
|
@ -1296,6 +1296,13 @@
|
|||
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
|
||||
]
|
||||
},
|
||||
"surface descriptor from HTML canvas id": {
|
||||
"category": "structure",
|
||||
"chained": true,
|
||||
"members": [
|
||||
{"name": "id", "type": "char", "annotation": "const*", "length": "strlen"}
|
||||
]
|
||||
},
|
||||
"surface descriptor from metal layer": {
|
||||
"category": "structure",
|
||||
"chained": true,
|
||||
|
@ -1349,7 +1356,8 @@
|
|||
{"value": 0, "name": "invalid"},
|
||||
{"value": 1, "name": "surface descriptor from metal layer"},
|
||||
{"value": 2, "name": "surface descriptor from windows HWND"},
|
||||
{"value": 3, "name": "surface descriptor from xlib"}
|
||||
{"value": 3, "name": "surface descriptor from xlib"},
|
||||
{"value": 4, "name": "surface descriptor from HTML canvas id"}
|
||||
]
|
||||
},
|
||||
"texture": {
|
||||
|
|
|
@ -95,6 +95,7 @@ namespace dawn_native {
|
|||
} break;
|
||||
#endif // defined(DAWN_USE_X11)
|
||||
|
||||
case wgpu::SType::SurfaceDescriptorFromHTMLCanvasId:
|
||||
default:
|
||||
return DAWN_VALIDATION_ERROR("Unsupported sType");
|
||||
}
|
||||
|
|
|
@ -110,6 +110,17 @@ TEST_F(WindowSurfaceInstanceTests, BadChainedDescriptors) {
|
|||
AssertSurfaceCreation(&descriptor, false);
|
||||
}
|
||||
|
||||
// Test that a chained descriptor with HTMLCanvas produces an error.
|
||||
TEST_F(WindowSurfaceInstanceTests, HTMLCanvasDescriptor) {
|
||||
wgpu::SurfaceDescriptorFromHTMLCanvasId chainedDescriptor;
|
||||
chainedDescriptor.id = "myCanvas";
|
||||
|
||||
wgpu::SurfaceDescriptor descriptor;
|
||||
descriptor.nextInChain = &chainedDescriptor;
|
||||
|
||||
AssertSurfaceCreation(&descriptor, false);
|
||||
}
|
||||
|
||||
// Test that it is invalid to give two valid chained descriptors
|
||||
TEST_F(WindowSurfaceInstanceTests, TwoChainedDescriptors) {
|
||||
GLFWwindow* window = CreateWindow();
|
||||
|
|
Loading…
Reference in New Issue