void ReleaseUnmanagedResources() { if (mFramebuffers != null) { foreach (var fb in mFramebuffers) { fb.DestroyFramebuffer(mPartition.Device, null); } mFramebuffers = null; } if (mRenderpass != null) { mRenderpass.DestroyRenderPass(mPartition.Device, null); mRenderpass = null; } if (mView != null) { mView.DestroyImageView(mPartition.Device, null); mView = null; } if (mImage != null) { mImage.DestroyImage(mPartition.Device, null); mImage = null; } if (mDeviceMemory != null) { mDeviceMemory.FreeMemory(mPartition.Device, null); mDeviceMemory = null; } }
/** * 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() { mFramebuffers.Clear(); if (mRenderpass != null) { mRenderpass.DestroyRenderPass(mGraphicsConfiguration.Partition.Device, null); mRenderpass = null; } if (mDepthStencilImageView != null) { mDepthStencilImageView.DestroyImageView(mGraphicsConfiguration.Partition.Device, null); mDepthStencilImageView = null; } if (mImage != null) { mImage.DestroyImage(mGraphicsConfiguration.Partition.Device, null); mImage = null; } if (mDeviceMemory != null) { mDeviceMemory.FreeMemory(mGraphicsConfiguration.Partition.Device, null); mDeviceMemory = 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(); } }