2019-01-15 18:18:06 -08:00
|
|
|
// Copyright 2019 The Dawn Authors
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2022-02-04 04:51:25 -08:00
|
|
|
#include "dawn/wire/WireClient.h"
|
|
|
|
#include "dawn/wire/client/Client.h"
|
2019-01-15 18:18:06 -08:00
|
|
|
|
2022-01-11 01:57:33 -08:00
|
|
|
namespace dawn::wire {
|
2019-02-11 13:50:16 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
WireClient::WireClient(const WireClientDescriptor& descriptor)
|
|
|
|
: mImpl(new client::Client(descriptor.serializer, descriptor.memoryTransferService)) {}
|
2019-02-11 13:50:16 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
WireClient::~WireClient() {
|
|
|
|
mImpl.reset();
|
|
|
|
}
|
2019-02-11 13:50:16 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
const volatile char* WireClient::HandleCommands(const volatile char* commands, size_t size) {
|
|
|
|
return mImpl->HandleCommands(commands, size);
|
|
|
|
}
|
2019-02-11 13:50:16 -08:00
|
|
|
|
2022-06-19 13:13:01 -07:00
|
|
|
ReservedTexture WireClient::ReserveTexture(WGPUDevice device,
|
|
|
|
const WGPUTextureDescriptor* descriptor) {
|
|
|
|
return mImpl->ReserveTexture(device, descriptor);
|
2022-05-01 07:40:55 -07:00
|
|
|
}
|
2019-03-28 05:57:11 -07:00
|
|
|
|
2023-05-26 03:32:17 -07:00
|
|
|
ReservedSwapChain WireClient::ReserveSwapChain(WGPUDevice device,
|
|
|
|
const WGPUSwapChainDescriptor* descriptor) {
|
|
|
|
return mImpl->ReserveSwapChain(device, descriptor);
|
2022-05-01 07:40:55 -07:00
|
|
|
}
|
2021-04-12 18:26:04 -07:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
ReservedDevice WireClient::ReserveDevice() {
|
|
|
|
return mImpl->ReserveDevice();
|
|
|
|
}
|
2021-01-19 11:27:52 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
ReservedInstance WireClient::ReserveInstance() {
|
|
|
|
return mImpl->ReserveInstance();
|
|
|
|
}
|
2021-12-14 15:22:46 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
void WireClient::ReclaimTextureReservation(const ReservedTexture& reservation) {
|
|
|
|
mImpl->ReclaimTextureReservation(reservation);
|
|
|
|
}
|
2021-01-21 16:25:05 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
void WireClient::ReclaimSwapChainReservation(const ReservedSwapChain& reservation) {
|
|
|
|
mImpl->ReclaimSwapChainReservation(reservation);
|
|
|
|
}
|
2021-04-12 18:26:04 -07:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
void WireClient::ReclaimDeviceReservation(const ReservedDevice& reservation) {
|
|
|
|
mImpl->ReclaimDeviceReservation(reservation);
|
|
|
|
}
|
2021-01-21 16:25:05 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
void WireClient::ReclaimInstanceReservation(const ReservedInstance& reservation) {
|
|
|
|
mImpl->ReclaimInstanceReservation(reservation);
|
|
|
|
}
|
2021-12-14 15:22:46 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
void WireClient::Disconnect() {
|
|
|
|
mImpl->Disconnect();
|
|
|
|
}
|
2020-04-14 19:00:14 -07:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
namespace client {
|
|
|
|
MemoryTransferService::MemoryTransferService() = default;
|
2020-11-03 06:24:05 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
MemoryTransferService::~MemoryTransferService() = default;
|
2019-07-19 09:01:48 -07:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
MemoryTransferService::ReadHandle::ReadHandle() = default;
|
2020-11-03 06:24:05 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
MemoryTransferService::ReadHandle::~ReadHandle() = default;
|
2019-07-19 09:01:48 -07:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
MemoryTransferService::WriteHandle::WriteHandle() = default;
|
2020-11-03 06:24:05 -08:00
|
|
|
|
2022-05-01 07:40:55 -07:00
|
|
|
MemoryTransferService::WriteHandle::~WriteHandle() = default;
|
|
|
|
} // namespace client
|
2019-07-19 09:01:48 -07:00
|
|
|
|
2022-01-11 01:57:33 -08:00
|
|
|
} // namespace dawn::wire
|