diff --git a/src/dawn_native/Device.cpp b/src/dawn_native/Device.cpp index cf65c420d0..67020a0dbe 100644 --- a/src/dawn_native/Device.cpp +++ b/src/dawn_native/Device.cpp @@ -902,19 +902,6 @@ namespace dawn_native { return !IsDeviceIdle(); } - void DeviceBase::Reference() { - ASSERT(mRefCount != 0); - mRefCount++; - } - - void DeviceBase::Release() { - ASSERT(mRefCount != 0); - mRefCount--; - if (mRefCount == 0) { - delete this; - } - } - QueueBase* DeviceBase::GetQueue() { // Backends gave the primary queue during initialization. ASSERT(mQueue != nullptr); diff --git a/src/dawn_native/Device.h b/src/dawn_native/Device.h index 53e3cc9bd7..32d676791c 100644 --- a/src/dawn_native/Device.h +++ b/src/dawn_native/Device.h @@ -41,7 +41,7 @@ namespace dawn_native { struct InternalPipelineStore; struct ShaderModuleParseResult; - class DeviceBase { + class DeviceBase : public RefCounted { public: DeviceBase(AdapterBase* adapter, const DeviceDescriptor* descriptor); virtual ~DeviceBase(); @@ -183,9 +183,6 @@ namespace dawn_native { PersistentCache* GetPersistentCache(); - void Reference(); - void Release(); - virtual ResultOrError> CreateStagingBuffer( size_t size) = 0; virtual MaybeError CopyFromStagingToBuffer(StagingBufferBase* source, @@ -390,7 +387,6 @@ namespace dawn_native { struct DeprecationWarnings; std::unique_ptr mDeprecationWarnings; - uint32_t mRefCount = 1; State mState = State::BeingCreated; FormatTable mFormatTable;