Ensure all wire child objects are destroyed before their device

Destroying a device will implicit destroy all its child objects.
Attempting to use a child object after results in a fatal error.

Bug: dawn:384
Change-Id: I43c27c92cacde759be83cca79ac890f41bac3927
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37002
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Austin Eng
2021-01-13 20:58:18 +00:00
committed by Commit Bot service account
parent 0562802757
commit 8ba0a01d1e
19 changed files with 240 additions and 28 deletions

View File

@@ -34,6 +34,8 @@ namespace dawn_wire {
WGPUTexture texture;
uint32_t id;
uint32_t generation;
uint32_t deviceId;
uint32_t deviceGeneration;
};
struct DAWN_WIRE_EXPORT WireClientDescriptor {

View File

@@ -43,7 +43,12 @@ namespace dawn_wire {
const volatile char* HandleCommands(const volatile char* commands,
size_t size) override final;
bool InjectTexture(WGPUTexture texture, uint32_t id, uint32_t generation);
// TODO(enga): Remove defaults after updating Chrome.
bool InjectTexture(WGPUTexture texture,
uint32_t id,
uint32_t generation,
uint32_t deviceId = 1,
uint32_t deviceGeneration = 0);
private:
std::unique_ptr<server::Server> mImpl;