dawn_wire: Add an API to reclaim reserved devices and textures

Dawn Wire has a way to reserve an ID and generation on the client side,
but if these reservations are never injected on the server, then
it will be impossible to reclaim the in-use ObjectIDs.

Bug: dawn:565
Change-Id: I751fce237c881e8cbdeaba18ad0ec1e124bd7ac2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38281
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Austin Eng
2021-01-22 00:25:05 +00:00
committed by Commit Bot service account
parent cef68bc8b7
commit 45ce1fda88
6 changed files with 74 additions and 0 deletions

View File

@@ -118,6 +118,14 @@ namespace dawn_wire { namespace client {
return result;
}
void Client::ReclaimTextureReservation(const ReservedTexture& reservation) {
TextureAllocator().Free(FromAPI(reservation.texture));
}
void Client::ReclaimDeviceReservation(const ReservedDevice& reservation) {
DeviceAllocator().Free(FromAPI(reservation.device));
}
void Client::Disconnect() {
mDisconnected = true;
mSerializer = ChunkedCommandSerializer(NoopCommandSerializer::GetInstance());