dawn_native: Add RequestDevice to the Adapter

Adds a basic RequestDevice method to the adapter, only in
dawn_native. We will revisit this when we implement adapters
in dawn_wire.

RequestDevice allows us to have tests of the limit bounds
because it receives a callback which can return status codes
and error messages.

Bug: dawn:685
Change-Id: I7a68922b078c6a436f49a16346cb41fb9df9cfee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63982
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng
2021-09-10 21:07:39 +00:00
committed by Dawn LUCI CQ
parent dc7971ce58
commit 2092a66ab5
5 changed files with 52 additions and 1 deletions

View File

@@ -120,6 +120,10 @@ namespace dawn_native {
// On an error, nullptr is returned.
WGPUDevice CreateDevice(const DeviceDescriptor* deviceDescriptor = nullptr);
void RequestDevice(const DeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata);
// Reset the backend device object for testing purposes.
void ResetInternalDeviceForTesting();