dawn::wire::client: Make object constructors less barebones.

This uses the variadic template arguments to Client::Make to
pass more data to object constructors and move the copying of data from
descriptors into the constructors.

This required adding a descriptor to the textures created in
ReserveTexture. The descriptor should come from the outside to give the
correct reflection data to textures (for example textures from
GPUCanvasContext). So a descriptor argument is added to ReserveTexture
that currently defaults to nullptr, but will be required once current
uses are updated.

Bug: dawn:1451
Change-Id: I44cbd5718b8d75fdde3ab1321d24f69a8e2486de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93142
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez
2022-06-19 20:13:01 +00:00
committed by Dawn LUCI CQ
parent a55b29e0bd
commit 04f12142bd
11 changed files with 85 additions and 44 deletions

View File

@@ -70,7 +70,10 @@ class DAWN_WIRE_EXPORT WireClient : public CommandHandler {
const volatile char* HandleCommands(const volatile char* commands, size_t size) override;
ReservedTexture ReserveTexture(WGPUDevice device);
// TODO(dawn:1451): Remove the defaulting of descriptor once the callers are updated to provide
// one.
ReservedTexture ReserveTexture(WGPUDevice device,
const WGPUTextureDescriptor* descriptor = nullptr);
ReservedSwapChain ReserveSwapChain(WGPUDevice device);
ReservedDevice ReserveDevice();
ReservedInstance ReserveInstance();