/** * Release all Vulkan resources held by this buffer */ public void Destroy() { if (mBuffer != null) { mBuffer.DestroyBuffer(mDevice, null); } if (mDeviceMemory != null) { mDeviceMemory.FreeMemory(mDevice, null); } }
void ReleaseUnmanagedResources() { var device = mConfiguration.Device; if (device != null) { if (mSetLayout != null) { mSetLayout.DestroyDescriptorSetLayout(device, null); } if (mDescriptorPool != null) { if (mUniformDescriptorSet != null) { device.FreeDescriptorSets(mDescriptorPool, new[] { mUniformDescriptorSet }); } mDescriptorPool.DestroyDescriptorPool(device, null); } if (mPresentingCmdBuffers != null) { device.FreeCommandBuffers(mConfiguration.Partition.CommandPool, mPresentingCmdBuffers); } if (mRenderCmdBuffers != null) { device.FreeCommandBuffers(mConfiguration.Partition.CommandPool, mRenderCmdBuffers); } if (mDeviceMemory != null) { mDeviceMemory.FreeMemory(device, null); } if (mBuffer != null) { mBuffer.DestroyBuffer(device, null); } if (mPipelineState != null) { mPipelineState.DestroyPipeline(device, null); } if (mPipelineLayout != null) { mPipelineLayout.DestroyPipelineLayout(device, null); } } if (mSwapchains != null) { mSwapchains.Dispose(); } if (mGraphicsDevice != null) { mGraphicsDevice.Dispose(); } }