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

@@ -74,8 +74,9 @@ namespace dawn_wire { namespace server {
}
resultData->generation = pipelineObjectHandle.generation;
resultData->device = device;
if (!TrackDeviceChild(device, ObjectType::ComputePipeline, pipelineObjectHandle.id)) {
resultData->deviceInfo = device->info.get();
if (!TrackDeviceChild(resultData->deviceInfo, ObjectType::ComputePipeline,
pipelineObjectHandle.id)) {
return false;
}
@@ -140,8 +141,9 @@ namespace dawn_wire { namespace server {
}
resultData->generation = pipelineObjectHandle.generation;
resultData->device = device;
if (!TrackDeviceChild(device, ObjectType::RenderPipeline, pipelineObjectHandle.id)) {
resultData->deviceInfo = device->info.get();
if (!TrackDeviceChild(resultData->deviceInfo, ObjectType::RenderPipeline,
pipelineObjectHandle.id)) {
return false;
}