chromium/third_party/dawn/src/dawn/wire/client/Device.cpp

// Copyright 2019 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#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 =;

}  // namespace

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() {}

}  // namespace dawn::wire::client