#include "dawn/wire/client/Device.h"
#include <memory>
#include <string>
#include <utility>
#include "dawn/common/Assert.h"
#include "dawn/common/Log.h"
#include "dawn/wire/client/ApiObjects_autogen.h"
#include "dawn/wire/client/Client.h"
#include "dawn/wire/client/EventManager.h"
#include "partition_alloc/pointers/raw_ptr.h"
namespace dawn::wire::client {
namespace {
class PopErrorScopeEvent final : public TrackedEvent { … };
template <typename PipelineT, EventType Type, typename CallbackInfoT>
class CreatePipelineEventBase : public TrackedEvent { … };
CreateComputePipelineEvent;
CreateRenderPipelineEvent;
void LegacyDeviceLostCallback(WGPUDevice const*,
WGPUDeviceLostReason reason,
char const* message,
void* callback,
void* userdata) { … }
void LegacyDeviceLostCallback2(WGPUDevice const* device,
WGPUDeviceLostReason reason,
char const* message,
void* callback,
void* userdata) { … }
void LegacyUncapturedErrorCallback(WGPUDevice const*,
WGPUErrorType type,
const char* message,
void* callback,
void* userdata) { … }
static constexpr WGPUUncapturedErrorCallbackInfo2 kEmptyUncapturedErrorCallbackInfo = …;
}
class Device::DeviceLostEvent : public TrackedEvent { … };
Device::Device(const ObjectBaseParams& params,
const ObjectHandle& eventManagerHandle,
Adapter* adapter,
const WGPUDeviceDescriptor* descriptor)
: … { … }
ObjectType Device::GetObjectType() const { … }
bool Device::IsAlive() const { … }
void Device::WillDropLastExternalRef() { … }
WGPUStatus Device::GetLimits(WGPUSupportedLimits* limits) const { … }
bool Device::HasFeature(WGPUFeatureName feature) const { … }
size_t Device::EnumerateFeatures(WGPUFeatureName* features) const { … }
void Device::SetLimits(const WGPUSupportedLimits* limits) { … }
void Device::SetFeatures(const WGPUFeatureName* features, uint32_t featuresCount) { … }
void Device::HandleError(WGPUErrorType errorType, const char* message) { … }
void Device::HandleLogging(WGPULoggingType loggingType, const char* message) { … }
void Device::HandleDeviceLost(WGPUDeviceLostReason reason, const char* message) { … }
WGPUFuture Device::GetDeviceLostFuture() { … }
void Device::SetUncapturedErrorCallback(WGPUErrorCallback errorCallback, void* errorUserdata) { … }
void Device::SetLoggingCallback(WGPULoggingCallback callback, void* userdata) { … }
void Device::SetDeviceLostCallback(WGPUDeviceLostCallback callback, void* userdata) { … }
WireResult Client::DoDeviceLostCallback(ObjectHandle eventManager,
WGPUFuture future,
WGPUDeviceLostReason reason,
char const* message) { … }
void Device::PopErrorScope(WGPUErrorCallback callback, void* userdata) { … }
WGPUFuture Device::PopErrorScopeF(const WGPUPopErrorScopeCallbackInfo& callbackInfo) { … }
WGPUFuture Device::PopErrorScope2(const WGPUPopErrorScopeCallbackInfo2& callbackInfo) { … }
WireResult Client::DoDevicePopErrorScopeCallback(ObjectHandle eventManager,
WGPUFuture future,
WGPUErrorType errorType,
const char* message) { … }
void Device::InjectError(WGPUErrorType type, const char* message) { … }
WGPUBuffer Device::CreateBuffer(const WGPUBufferDescriptor* descriptor) { … }
WGPUBuffer Device::CreateErrorBuffer(const WGPUBufferDescriptor* descriptor) { … }
WGPUAdapter Device::GetAdapter() const { … }
WGPUQueue Device::GetQueue() { … }
template <typename Event, typename Cmd, typename CallbackInfo, typename Descriptor>
WGPUFuture Device::CreatePipelineAsyncF(Descriptor const* descriptor,
const CallbackInfo& callbackInfo) { … }
void Device::CreateComputePipelineAsync(WGPUComputePipelineDescriptor const* descriptor,
WGPUCreateComputePipelineAsyncCallback callback,
void* userdata) { … }
WGPUFuture Device::CreateComputePipelineAsyncF(
WGPUComputePipelineDescriptor const* descriptor,
const WGPUCreateComputePipelineAsyncCallbackInfo& callbackInfo) { … }
WGPUFuture Device::CreateComputePipelineAsync2(
WGPUComputePipelineDescriptor const* descriptor,
const WGPUCreateComputePipelineAsyncCallbackInfo2& callbackInfo) { … }
WireResult Client::DoDeviceCreateComputePipelineAsyncCallback(ObjectHandle eventManager,
WGPUFuture future,
WGPUCreatePipelineAsyncStatus status,
const char* message) { … }
void Device::CreateRenderPipelineAsync(WGPURenderPipelineDescriptor const* descriptor,
WGPUCreateRenderPipelineAsyncCallback callback,
void* userdata) { … }
WGPUFuture Device::CreateRenderPipelineAsyncF(
WGPURenderPipelineDescriptor const* descriptor,
const WGPUCreateRenderPipelineAsyncCallbackInfo& callbackInfo) { … }
WGPUFuture Device::CreateRenderPipelineAsync2(
WGPURenderPipelineDescriptor const* descriptor,
const WGPUCreateRenderPipelineAsyncCallbackInfo2& callbackInfo) { … }
WireResult Client::DoDeviceCreateRenderPipelineAsyncCallback(ObjectHandle eventManager,
WGPUFuture future,
WGPUCreatePipelineAsyncStatus status,
const char* message) { … }
void Device::Destroy() { … }
}