public void Dispose() { //if (mPresentationLayer != null) //{ // mPresentationLayer.Dispose(); //} if (mGraphicsDevice != null) { mGraphicsDevice.Dispose(); } if (mSwapchains != null) { mSwapchains.Dispose(); } if (mConfiguration != null) { mConfiguration.Dispose(); } }
public void Dispose() { if (mGraphicsDevice != null) { mGraphicsDevice.Dispose(); } if (mSwapchains != null) { mSwapchains.Dispose(); } if (mConfiguration != null) { if (PresentComplete != null) { PresentComplete.DestroySemaphore(mConfiguration.Device, null); } if (mConfiguration.Partition != null) { var commandPool = mConfiguration.Partition.CommandPool; if (commandPool != null) { if (mPresentBuffers != null) { mConfiguration.Device.FreeCommandBuffers( commandPool, mPresentBuffers); mPresentBuffers = null; } } } mConfiguration.Dispose(); } }
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(); } }