dawn_wire: Fix a bug with multiple injected devices

Device child objects were storing an *unstable* pointer to device
specific tracking information. Fix this by moving the tracking
information to a stable heap allocation.

Bug: dawn:565
Change-Id: I00ad72563ac66e29314603e77698718953fcbf15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38280
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng
2021-01-21 23:15:43 +00:00
committed by Commit Bot service account
parent b5cfe3a774
commit cef68bc8b7
8 changed files with 82 additions and 29 deletions

View File

@@ -137,8 +137,8 @@ namespace dawn_wire { namespace server {
}
resultData->generation = bufferResult.generation;
resultData->handle = mProcs.deviceCreateBuffer(device->handle, descriptor);
resultData->device = device;
if (!TrackDeviceChild(device, ObjectType::Buffer, bufferResult.id)) {
resultData->deviceInfo = device->info.get();
if (!TrackDeviceChild(resultData->deviceInfo, ObjectType::Buffer, bufferResult.id)) {
return false;
}