[chromium-style] Adding/moving constructors and destructors.

This CL adds missing constructors and destructors. Others are moved
from the header file to implementation files.

Bug: dawn:1405
Change-Id: I06657d4a4faa437ca5a95a0067a8f9f9bbc89d12
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89181
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
dan sinclair 2022-05-09 22:22:18 +00:00 committed by Dawn LUCI CQ
parent b61e0452f8
commit 61f30bad1e
56 changed files with 164 additions and 16 deletions

View File

@ -77,4 +77,8 @@ void AsyncTaskManager::DoWaitableTask(void* task) {
waitableTask->taskManager->HandleTaskCompletion(waitableTask.Get());
}
AsyncTaskManager::WaitableTask::WaitableTask() = default;
AsyncTaskManager::WaitableTask::~WaitableTask() = default;
} // namespace dawn::native

View File

@ -47,6 +47,9 @@ class AsyncTaskManager {
private:
class WaitableTask : public RefCounted {
public:
WaitableTask();
~WaitableTask();
AsyncTask asyncTask;
AsyncTaskManager* taskManager;
std::unique_ptr<dawn::platform::WaitableEvent> waitableEvent;

View File

@ -27,6 +27,12 @@ CachedBlob::CachedBlob(size_t size) {
}
}
CachedBlob::CachedBlob(CachedBlob&&) = default;
CachedBlob::~CachedBlob() = default;
CachedBlob& CachedBlob::operator=(CachedBlob&&) = default;
bool CachedBlob::Empty() const {
return mSize == 0;
}

View File

@ -31,6 +31,10 @@ class InstanceBase;
class CachedBlob {
public:
explicit CachedBlob(size_t size = 0);
CachedBlob(CachedBlob&&);
~CachedBlob();
CachedBlob& operator=(CachedBlob&&);
bool Empty() const;
const uint8_t* Data() const;

View File

@ -34,6 +34,8 @@ BuddyMemoryAllocator::BuddyMemoryAllocator(uint64_t maxSystemSize,
mTrackedSubAllocations.resize(maxSystemSize / mMemoryBlockSize);
}
BuddyMemoryAllocator::~BuddyMemoryAllocator() = default;
uint64_t BuddyMemoryAllocator::GetMemoryIndex(uint64_t offset) const {
ASSERT(offset != BuddyAllocator::kInvalidOffset);
return offset / mMemoryBlockSize;

View File

@ -42,7 +42,7 @@ class BuddyMemoryAllocator {
BuddyMemoryAllocator(uint64_t maxSystemSize,
uint64_t memoryBlockSize,
ResourceHeapAllocator* heapAllocator);
~BuddyMemoryAllocator() = default;
~BuddyMemoryAllocator();
ResultOrError<ResourceMemoryAllocation> Allocate(uint64_t allocationSize, uint64_t alignment);
void Deallocate(const ResourceMemoryAllocation& allocation);

View File

@ -18,6 +18,10 @@
namespace dawn::native {
CallbackTaskManager::CallbackTaskManager() = default;
CallbackTaskManager::~CallbackTaskManager() = default;
bool CallbackTaskManager::IsEmpty() {
std::lock_guard<std::mutex> lock(mCallbackTaskQueueMutex);
return mCallbackTaskQueue.empty();

View File

@ -31,6 +31,9 @@ struct CallbackTask {
class CallbackTaskManager {
public:
CallbackTaskManager();
~CallbackTaskManager();
void AddCallbackTask(std::unique_ptr<CallbackTask> callbackTask);
bool IsEmpty();
std::vector<std::unique_ptr<CallbackTask>> AcquireCallbackTasks();

View File

@ -30,6 +30,8 @@ CreatePipelineAsyncCallbackTaskBase::CreatePipelineAsyncCallbackTaskBase(std::st
void* userdata)
: mErrorMessage(errorMessage), mUserData(userdata) {}
CreatePipelineAsyncCallbackTaskBase::~CreatePipelineAsyncCallbackTaskBase() = default;
CreateComputePipelineAsyncCallbackTask::CreateComputePipelineAsyncCallbackTask(
Ref<ComputePipelineBase> pipeline,
std::string errorMessage,
@ -39,6 +41,8 @@ CreateComputePipelineAsyncCallbackTask::CreateComputePipelineAsyncCallbackTask(
mPipeline(std::move(pipeline)),
mCreateComputePipelineAsyncCallback(callback) {}
CreateComputePipelineAsyncCallbackTask::~CreateComputePipelineAsyncCallbackTask() = default;
void CreateComputePipelineAsyncCallbackTask::Finish() {
ASSERT(mCreateComputePipelineAsyncCallback != nullptr);
@ -74,6 +78,8 @@ CreateRenderPipelineAsyncCallbackTask::CreateRenderPipelineAsyncCallbackTask(
mPipeline(std::move(pipeline)),
mCreateRenderPipelineAsyncCallback(callback) {}
CreateRenderPipelineAsyncCallbackTask::~CreateRenderPipelineAsyncCallbackTask() = default;
void CreateRenderPipelineAsyncCallbackTask::Finish() {
ASSERT(mCreateRenderPipelineAsyncCallback != nullptr);
@ -110,6 +116,8 @@ CreateComputePipelineAsyncTask::CreateComputePipelineAsyncTask(
ASSERT(mComputePipeline != nullptr);
}
CreateComputePipelineAsyncTask::~CreateComputePipelineAsyncTask() = default;
void CreateComputePipelineAsyncTask::Run() {
const char* eventLabel = utils::GetLabelForTrace(mComputePipeline->GetLabel().c_str());
@ -160,6 +168,8 @@ CreateRenderPipelineAsyncTask::CreateRenderPipelineAsyncTask(
ASSERT(mRenderPipeline != nullptr);
}
CreateRenderPipelineAsyncTask::~CreateRenderPipelineAsyncTask() = default;
void CreateRenderPipelineAsyncTask::Run() {
const char* eventLabel = utils::GetLabelForTrace(mRenderPipeline->GetLabel().c_str());

View File

@ -34,6 +34,7 @@ struct FlatComputePipelineDescriptor;
struct CreatePipelineAsyncCallbackTaskBase : CallbackTask {
CreatePipelineAsyncCallbackTaskBase(std::string errorMessage, void* userData);
~CreatePipelineAsyncCallbackTaskBase();
protected:
std::string mErrorMessage;
@ -45,6 +46,7 @@ struct CreateComputePipelineAsyncCallbackTask : CreatePipelineAsyncCallbackTaskB
std::string errorMessage,
WGPUCreateComputePipelineAsyncCallback callback,
void* userdata);
~CreateComputePipelineAsyncCallbackTask() override;
void Finish() override;
void HandleShutDown() final;
@ -60,6 +62,7 @@ struct CreateRenderPipelineAsyncCallbackTask : CreatePipelineAsyncCallbackTaskBa
std::string errorMessage,
WGPUCreateRenderPipelineAsyncCallback callback,
void* userdata);
~CreateRenderPipelineAsyncCallbackTask() override;
void Finish() override;
void HandleShutDown() final;
@ -77,6 +80,7 @@ class CreateComputePipelineAsyncTask {
CreateComputePipelineAsyncTask(Ref<ComputePipelineBase> nonInitializedComputePipeline,
WGPUCreateComputePipelineAsyncCallback callback,
void* userdata);
~CreateComputePipelineAsyncTask();
void Run();
@ -95,6 +99,7 @@ class CreateRenderPipelineAsyncTask {
CreateRenderPipelineAsyncTask(Ref<RenderPipelineBase> nonInitializedRenderPipeline,
WGPUCreateRenderPipelineAsyncCallback callback,
void* userdata);
~CreateRenderPipelineAsyncTask();
void Run();

View File

@ -45,6 +45,10 @@ const char* ErrorScope::GetErrorMessage() const {
return mErrorMessage.c_str();
}
ErrorScopeStack::ErrorScopeStack() = default;
ErrorScopeStack::~ErrorScopeStack() = default;
void ErrorScopeStack::Push(wgpu::ErrorFilter filter) {
mScopes.push_back(ErrorScope(filter));
}

View File

@ -38,6 +38,9 @@ class ErrorScope {
class ErrorScopeStack {
public:
ErrorScopeStack();
~ErrorScopeStack();
void Push(wgpu::ErrorFilter errorFilter);
ErrorScope Pop();

View File

@ -232,6 +232,8 @@ FeaturesInfo::FeaturesInfo() {
}
}
FeaturesInfo::~FeaturesInfo() = default;
const FeatureInfo* FeaturesInfo::GetFeatureInfo(wgpu::FeatureName feature) const {
Feature f = FromAPIFeature(feature);
if (f == Feature::InvalidEnum) {

View File

@ -68,6 +68,7 @@ wgpu::FeatureName FeatureEnumToAPIFeature(Feature feature);
class FeaturesInfo {
public:
FeaturesInfo();
~FeaturesInfo();
// Used to query the details of an feature. Return nullptr if featureName is not a valid
// name of an feature supported in Dawn

View File

@ -122,6 +122,10 @@ Ref<InstanceBase> InstanceBase::Create(const InstanceDescriptor* descriptor) {
return instance;
}
InstanceBase::InstanceBase() = default;
InstanceBase::~InstanceBase() = default;
// TODO(crbug.com/dawn/832): make the platform an initialization parameter of the instance.
MaybeError InstanceBase::Initialize(const InstanceDescriptor* descriptor) {
DAWN_TRY(ValidateSingleSType(descriptor->nextInChain, wgpu::SType::DawnInstanceDescriptor));

View File

@ -93,8 +93,8 @@ class InstanceBase final : public RefCounted {
Surface* APICreateSurface(const SurfaceDescriptor* descriptor);
private:
InstanceBase() = default;
~InstanceBase() override = default;
InstanceBase();
~InstanceBase() override;
InstanceBase(const InstanceBase& other) = delete;
InstanceBase& operator=(const InstanceBase& other) = delete;

View File

@ -23,6 +23,8 @@ namespace dawn::native {
PooledResourceMemoryAllocator::PooledResourceMemoryAllocator(ResourceHeapAllocator* heapAllocator)
: mHeapAllocator(heapAllocator) {}
PooledResourceMemoryAllocator::~PooledResourceMemoryAllocator() = default;
void PooledResourceMemoryAllocator::DestroyPool() {
for (auto& resourceHeap : mPool) {
ASSERT(resourceHeap != nullptr);

View File

@ -32,7 +32,7 @@ class DeviceBase;
class PooledResourceMemoryAllocator : public ResourceHeapAllocator {
public:
explicit PooledResourceMemoryAllocator(ResourceHeapAllocator* heapAllocator);
~PooledResourceMemoryAllocator() override = default;
~PooledResourceMemoryAllocator() override;
ResultOrError<std::unique_ptr<ResourceHeapBase>> AllocateResourceHeap(uint64_t size) override;
void DeallocateResourceHeap(std::unique_ptr<ResourceHeapBase> allocation) override;

View File

@ -30,8 +30,16 @@
// used bytes.
namespace dawn::native {
RingBufferAllocator::RingBufferAllocator() = default;
RingBufferAllocator::RingBufferAllocator(uint64_t maxSize) : mMaxBlockSize(maxSize) {}
RingBufferAllocator::RingBufferAllocator(const RingBufferAllocator&) = default;
RingBufferAllocator::~RingBufferAllocator() = default;
RingBufferAllocator& RingBufferAllocator::operator=(const RingBufferAllocator&) = default;
void RingBufferAllocator::Deallocate(ExecutionSerial lastCompletedSerial) {
// Reclaim memory from previously recorded blocks.
for (Request& request : mInflightRequests.IterateUpTo(lastCompletedSerial)) {

View File

@ -26,11 +26,12 @@ namespace dawn::native {
class RingBufferAllocator {
public:
RingBufferAllocator() = default;
RingBufferAllocator();
explicit RingBufferAllocator(uint64_t maxSize);
~RingBufferAllocator() = default;
RingBufferAllocator(const RingBufferAllocator&) = default;
RingBufferAllocator& operator=(const RingBufferAllocator&) = default;
RingBufferAllocator(const RingBufferAllocator&);
~RingBufferAllocator();
RingBufferAllocator& operator=(const RingBufferAllocator&);
uint64_t Allocate(uint64_t allocationSize, ExecutionSerial serial);
void Deallocate(ExecutionSerial lastCompletedSerial);

View File

@ -313,6 +313,10 @@ const char* ToggleEnumToName(Toggle toggle) {
return toggleNameAndInfo.info.name;
}
TogglesInfo::TogglesInfo() = default;
TogglesInfo::~TogglesInfo() = default;
const ToggleInfo* TogglesInfo::GetToggleInfo(const char* toggleName) {
ASSERT(toggleName);

View File

@ -91,6 +91,9 @@ const char* ToggleEnumToName(Toggle toggle);
class TogglesInfo {
public:
TogglesInfo();
~TogglesInfo();
// Used to query the details of a toggle. Return nullptr if toggleName is not a valid name
// of a toggle supported in Dawn.
const ToggleInfo* GetToggleInfo(const char* toggleName);

View File

@ -24,6 +24,7 @@ namespace dawn::native::metal {
class Backend : public BackendConnection {
public:
explicit Backend(InstanceBase* instance);
~Backend() override;
std::vector<Ref<AdapterBase>> DiscoverDefaultAdapters() override;
ResultOrError<std::vector<Ref<AdapterBase>>> DiscoverAdapters(

View File

@ -608,6 +608,8 @@ Backend::Backend(InstanceBase* instance) : BackendConnection(instance, wgpu::Bac
}
}
Backend::~Backend() = default;
std::vector<Ref<AdapterBase>> Backend::DiscoverDefaultAdapters() {
AdapterDiscoveryOptions options;
auto result = DiscoverAdapters(&options);

View File

@ -36,7 +36,7 @@ class BindGroupLayout final : public BindGroupLayoutBase {
BindGroupLayout(DeviceBase* device,
const BindGroupLayoutDescriptor* descriptor,
PipelineCompatibilityToken pipelineCompatibilityToken);
~BindGroupLayout() override = default;
~BindGroupLayout() override;
SlabAllocator<BindGroup> mBindGroupAllocator;
};

View File

@ -32,6 +32,8 @@ BindGroupLayout::BindGroupLayout(DeviceBase* device,
: BindGroupLayoutBase(device, descriptor, pipelineCompatibilityToken),
mBindGroupAllocator(MakeFrontendBindGroupAllocator<BindGroup>(4096)) {}
BindGroupLayout::~BindGroupLayout() = default;
Ref<BindGroup> BindGroupLayout::AllocateBindGroup(Device* device,
const BindGroupDescriptor* descriptor) {
return AcquireRef(mBindGroupAllocator.Allocate(device, descriptor));

View File

@ -29,6 +29,9 @@ class Device;
class Buffer final : public BufferBase {
public:
static ResultOrError<Ref<Buffer>> Create(Device* device, const BufferDescriptor* descriptor);
Buffer(DeviceBase* device, const BufferDescriptor* descriptor);
id<MTLBuffer> GetMTLBuffer() const;
bool EnsureDataInitialized(CommandRecordingContext* commandContext);
@ -45,6 +48,7 @@ class Buffer final : public BufferBase {
MaybeError Initialize(bool mappedAtCreation);
~Buffer() override;
MaybeError MapAsyncImpl(wgpu::MapMode mode, size_t offset, size_t size) override;
void UnmapImpl() override;
void DestroyImpl() override;

View File

@ -59,6 +59,8 @@ uint64_t Buffer::QueryMaxBufferLength(id<MTLDevice> mtlDevice) {
#endif
}
Buffer::Buffer(DeviceBase* dev, const BufferDescriptor* desc) : BufferBase(dev, desc) {}
MaybeError Buffer::Initialize(bool mappedAtCreation) {
MTLResourceOptions storageMode;
if (GetUsage() & kMappableBufferUsages) {

View File

@ -47,6 +47,9 @@ class CommandBuffer final : public CommandBufferBase {
static Ref<CommandBuffer> Create(CommandEncoder* encoder,
const CommandBufferDescriptor* descriptor);
CommandBuffer(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor);
~CommandBuffer();
MaybeError FillCommands(CommandRecordingContext* commandContext);
private:

View File

@ -577,6 +577,11 @@ Ref<CommandBuffer> CommandBuffer::Create(CommandEncoder* encoder,
return AcquireRef(new CommandBuffer(encoder, descriptor));
}
CommandBuffer::CommandBuffer(CommandEncoder* enc, const CommandBufferDescriptor* desc)
: CommandBufferBase(enc, desc) {}
CommandBuffer::~CommandBuffer() = default;
MaybeError CommandBuffer::FillCommands(CommandRecordingContext* commandContext) {
size_t nextComputePassNumber = 0;
size_t nextRenderPassNumber = 0;

View File

@ -35,6 +35,9 @@ class ComputePipeline final : public ComputePipelineBase {
WGPUCreateComputePipelineAsyncCallback callback,
void* userdata);
ComputePipeline(DeviceBase* device, const ComputePipelineDescriptor* descriptor);
~ComputePipeline() override;
void Encode(id<MTLComputeCommandEncoder> encoder);
MTLSize GetLocalWorkGroupSize() const;
bool RequiresStorageBufferLength() const;

View File

@ -29,6 +29,11 @@ Ref<ComputePipeline> ComputePipeline::CreateUninitialized(
return AcquireRef(new ComputePipeline(device, descriptor));
}
ComputePipeline::ComputePipeline(DeviceBase* dev, const ComputePipelineDescriptor* desc)
: ComputePipelineBase(dev, desc) {}
ComputePipeline::~ComputePipeline() = default;
MaybeError ComputePipeline::Initialize() {
auto mtlDevice = ToBackend(GetDevice())->GetMTLDevice();

View File

@ -51,7 +51,7 @@ class PipelineLayout final : public PipelineLayoutBase {
private:
PipelineLayout(Device* device, const PipelineLayoutDescriptor* descriptor);
~PipelineLayout() override = default;
~PipelineLayout() override;
PerStage<BindingIndexInfo> mIndexInfo;
PerStage<uint32_t> mBufferBindingCount;
};

View File

@ -70,6 +70,8 @@ PipelineLayout::PipelineLayout(Device* device, const PipelineLayoutDescriptor* d
}
}
PipelineLayout::~PipelineLayout() = default;
const PipelineLayout::BindingIndexInfo& PipelineLayout::GetBindingIndexInfo(
SingleShaderStage stage) const {
return mIndexInfo[stage];

View File

@ -30,15 +30,18 @@ class QuerySet final : public QuerySetBase {
static ResultOrError<Ref<QuerySet>> Create(Device* device,
const QuerySetDescriptor* descriptor);
QuerySet(DeviceBase* device, const QuerySetDescriptor* descriptor);
id<MTLBuffer> GetVisibilityBuffer() const;
id<MTLCounterSampleBuffer> GetCounterSampleBuffer() const
API_AVAILABLE(macos(10.15), ios(14.0));
private:
~QuerySet() override;
using QuerySetBase::QuerySetBase;
MaybeError Initialize();
~QuerySet() override;
// Dawn API
void DestroyImpl() override;

View File

@ -68,6 +68,8 @@ ResultOrError<Ref<QuerySet>> QuerySet::Create(Device* device,
return queryset;
}
QuerySet::QuerySet(DeviceBase* dev, const QuerySetDescriptor* desc) : QuerySetBase(dev, desc) {}
MaybeError QuerySet::Initialize() {
Device* device = ToBackend(GetDevice());

View File

@ -24,6 +24,7 @@ class Device;
class Queue final : public QueueBase {
public:
Queue(Device* device, const QueueDescriptor* descriptor);
~Queue() override;
private:
MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override;

View File

@ -28,6 +28,8 @@ namespace dawn::native::metal {
Queue::Queue(Device* device, const QueueDescriptor* descriptor) : QueueBase(device, descriptor) {}
Queue::~Queue() = default;
MaybeError Queue::SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) {
Device* device = ToBackend(GetDevice());

View File

@ -33,6 +33,9 @@ class RenderPipeline final : public RenderPipelineBase {
WGPUCreateRenderPipelineAsyncCallback callback,
void* userdata);
RenderPipeline(DeviceBase* device, const RenderPipelineDescriptor* descriptor);
~RenderPipeline() override;
MTLPrimitiveType GetMTLPrimitiveTopology() const;
MTLWinding GetMTLFrontFace() const;
MTLCullMode GetMTLCullMode() const;

View File

@ -310,6 +310,11 @@ Ref<RenderPipelineBase> RenderPipeline::CreateUninitialized(
return AcquireRef(new RenderPipeline(device, descriptor));
}
RenderPipeline::RenderPipeline(DeviceBase* dev, const RenderPipelineDescriptor* desc)
: RenderPipelineBase(dev, desc) {}
RenderPipeline::~RenderPipeline() = default;
MaybeError RenderPipeline::Initialize() {
mMtlPrimitiveTopology = MTLPrimitiveTopology(GetPrimitiveTopology());
mMtlFrontFace = MTLFrontFace(GetFrontFace());

View File

@ -29,6 +29,9 @@ class Sampler final : public SamplerBase {
public:
static ResultOrError<Ref<Sampler>> Create(Device* device, const SamplerDescriptor* descriptor);
Sampler(DeviceBase* device, const SamplerDescriptor* descriptor);
~Sampler() override;
id<MTLSamplerState> GetMTLSamplerState();
private:

View File

@ -64,6 +64,10 @@ ResultOrError<Ref<Sampler>> Sampler::Create(Device* device, const SamplerDescrip
return sampler;
}
Sampler::Sampler(DeviceBase* dev, const SamplerDescriptor* desc) : SamplerBase(dev, desc) {}
Sampler::~Sampler() = default;
MaybeError Sampler::Initialize(const SamplerDescriptor* descriptor) {
NSRef<MTLSamplerDescriptor> mtlDescRef = AcquireNSRef([MTLSamplerDescriptor new]);
MTLSamplerDescriptor* mtlDesc = mtlDescRef.Get();

View File

@ -65,7 +65,7 @@ class ShaderModule final : public ShaderModuleBase {
bool* hasInvariantAttribute,
std::vector<uint32_t>* workgroupAllocations);
ShaderModule(Device* device, const ShaderModuleDescriptor* descriptor);
~ShaderModule() override = default;
~ShaderModule() override;
MaybeError Initialize(ShaderModuleParseResult* parseResult,
OwnedCompilationMessages* compilationMessages);
};

View File

@ -42,6 +42,8 @@ ResultOrError<Ref<ShaderModule>> ShaderModule::Create(
ShaderModule::ShaderModule(Device* device, const ShaderModuleDescriptor* descriptor)
: ShaderModuleBase(device, descriptor) {}
ShaderModule::~ShaderModule() = default;
MaybeError ShaderModule::Initialize(ShaderModuleParseResult* parseResult,
OwnedCompilationMessages* compilationMessages) {
ScopedTintICEHandler scopedICEHandler(GetDevice());

View File

@ -28,6 +28,7 @@ class Device;
class StagingBuffer : public StagingBufferBase {
public:
StagingBuffer(size_t size, Device* device);
~StagingBuffer() override;
id<MTLBuffer> GetBufferHandle() const;

View File

@ -20,6 +20,8 @@ namespace dawn::native::metal {
StagingBuffer::StagingBuffer(size_t size, Device* device)
: StagingBufferBase(size), mDevice(device) {}
StagingBuffer::~StagingBuffer() = default;
MaybeError StagingBuffer::Initialize() {
const size_t bufferSize = GetSize();
mBuffer =

View File

@ -44,6 +44,8 @@ class SwapChain final : public NewSwapChainBase {
Surface* surface,
NewSwapChainBase* previousSwapChain,
const SwapChainDescriptor* descriptor);
SwapChain(DeviceBase* device, Surface* surface, const SwapChainDescriptor* descriptor);
~SwapChain() override;
private:

View File

@ -72,6 +72,9 @@ ResultOrError<Ref<SwapChain>> SwapChain::Create(Device* device,
return swapchain;
}
SwapChain::SwapChain(DeviceBase* dev, Surface* sur, const SwapChainDescriptor* desc)
: NewSwapChainBase(dev, sur, desc) {}
SwapChain::~SwapChain() = default;
void SwapChain::DestroyImpl() {

View File

@ -45,6 +45,8 @@ class Texture final : public TextureBase {
const TextureDescriptor* descriptor,
NSPRef<id<MTLTexture>> wrapped);
Texture(DeviceBase* device, const TextureDescriptor* descriptor, TextureState state);
id<MTLTexture> GetMTLTexture() const;
IOSurfaceRef GetIOSurface();
NSPRef<id<MTLTexture>> CreateFormatView(wgpu::TextureFormat format);

View File

@ -772,6 +772,9 @@ MaybeError Texture::InitializeFromIOSurface(const ExternalImageDescriptor* descr
return {};
}
Texture::Texture(DeviceBase* dev, const TextureDescriptor* desc, TextureState st)
: TextureBase(dev, desc, st) {}
Texture::~Texture() {}
void Texture::DestroyImpl() {

View File

@ -32,6 +32,8 @@ Adapter::Adapter(InstanceBase* instance,
mPhysicalDevice(physicalDevice),
mVulkanInstance(vulkanInstance) {}
Adapter::~Adapter() = default;
const VulkanDeviceInfo& Adapter::GetDeviceInfo() const {
return mDeviceInfo;
}

View File

@ -30,7 +30,7 @@ class Adapter : public AdapterBase {
Adapter(InstanceBase* instance,
VulkanInstance* vulkanInstance,
VkPhysicalDevice physicalDevice);
~Adapter() override = default;
~Adapter() override;
// AdapterBase Implementation
bool SupportsExternalImages() const override;

View File

@ -22,6 +22,8 @@
namespace dawn::wire {
ChunkedCommandHandler::ChunkedCommandHandler() = default;
ChunkedCommandHandler::~ChunkedCommandHandler() = default;
const volatile char* ChunkedCommandHandler::HandleCommands(const volatile char* commands,

View File

@ -27,9 +27,11 @@ namespace dawn::wire {
class ChunkedCommandHandler : public CommandHandler {
public:
const volatile char* HandleCommands(const volatile char* commands, size_t size) override;
ChunkedCommandHandler();
~ChunkedCommandHandler() override;
const volatile char* HandleCommands(const volatile char* commands, size_t size) override;
protected:
enum class ChunkedCommandsResult {
Passthrough,

View File

@ -17,6 +17,9 @@
namespace dawn::wire::server {
CallbackUserdata::CallbackUserdata(Server* server, const std::shared_ptr<bool>& serverIsAlive)
: server(server), serverIsAlive(serverIsAlive) {}
Server::Server(const DawnProcTable& procs,
CommandSerializer* serializer,
MemoryTransferService* memoryTransferService)

View File

@ -55,8 +55,7 @@ struct CallbackUserdata {
std::weak_ptr<bool> const serverIsAlive;
CallbackUserdata() = delete;
CallbackUserdata(Server* server, const std::shared_ptr<bool>& serverIsAlive)
: server(server), serverIsAlive(serverIsAlive) {}
CallbackUserdata(Server* server, const std::shared_ptr<bool>& serverIsAlive);
};
template <auto F>