Remove getBaseObject

Nothing used it, and you should always be able to `static_cast<MVKBaseObject*>` for any object without a crazy inheritance tree
This commit is contained in:
Evan Tang 2023-06-13 12:00:31 -05:00
parent 5a216ab1f8
commit aeae18d48b
5 changed files with 2 additions and 17 deletions

View File

@ -182,7 +182,6 @@ protected:
friend class MVKCommandEncoder;
friend class MVKCommandPool;
MVKBaseObject* getBaseObject() override { return this; };
void propagateDebugName() override {}
void init(const VkCommandBufferAllocateInfo* pAllocateInfo);
bool canExecute();

View File

@ -99,7 +99,6 @@ public:
protected:
friend class MVKMTLBufferAllocation;
MVKBaseObject* getBaseObject() override { return this; };
MVKMTLBufferAllocation* newObject() override;
void returnAllocationUnlocked(MVKMTLBufferAllocation* ba);
void returnAllocation(MVKMTLBufferAllocation* ba);

View File

@ -959,13 +959,9 @@ public:
bool isUsingPipelineStageMetalArgumentBuffers() { return isUsingMetalArgumentBuffers() && !_device->_pMetalFeatures->descriptorSetArgumentBuffers; };
/** Constructs an instance for the specified device. */
MVKDeviceTrackingMixin(MVKDevice* device) : _device(device) { assert(_device); }
virtual ~MVKDeviceTrackingMixin() {}
MVKDeviceTrackingMixin(MVKDevice* device) : _device(device) { assert(_device); }
protected:
virtual MVKBaseObject* getBaseObject() = 0;
MVKDevice* _device;
};
@ -980,9 +976,6 @@ public:
/** Constructs an instance for the specified device. */
MVKBaseDeviceObject(MVKDevice* device) : MVKDeviceTrackingMixin(device) {}
protected:
MVKBaseObject* getBaseObject() override { return this; };
};
@ -999,10 +992,6 @@ public:
/** Constructs an instance for the specified device. */
MVKVulkanAPIDeviceObject(MVKDevice* device) : MVKDeviceTrackingMixin(device) {}
protected:
MVKBaseObject* getBaseObject() override { return this; };
};
@ -1055,7 +1044,6 @@ public:
protected:
T* newObject() override { return new T(_device); }
MVKBaseObject* getBaseObject() override { return this; };
};

View File

@ -135,7 +135,6 @@ protected:
friend class MVKQueueCommandBufferSubmission;
friend class MVKQueuePresentSurfaceSubmission;
MVKBaseObject* getBaseObject() override { return this; };
void propagateDebugName() override;
void initName();
void initExecQueue();

View File

@ -105,7 +105,7 @@ public:
/** Destroys this object. Default behaviour simply deletes it. Subclasses may override to delay deletion. */
virtual void destroy() { delete this; }
virtual ~MVKBaseObject() {}
virtual ~MVKBaseObject() {}
protected:
static VkResult reportResult(MVKBaseObject* mvkObj, VkResult vkRslt, MVKConfigLogLevel logLevel, const char* format, va_list args) __printflike(4, 0);