mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-02-05 15:24:22 +01:00
[rpcsx-gpu] cleanup resources properly
This commit is contained in:
parent
adacb8daa6
commit
f9ac0426bf
|
|
@ -790,7 +790,12 @@ int main(int argc, const char *argv[]) {
|
|||
vkDestroyBuffer(vkDevice, handle, nullptr);
|
||||
}
|
||||
|
||||
for (auto handle : swapchainImageHandles[imageIndex]) {
|
||||
vkDestroyImage(vkDevice, handle, nullptr);
|
||||
}
|
||||
|
||||
swapchainBufferHandles[imageIndex].clear();
|
||||
swapchainImageHandles[imageIndex].clear();
|
||||
|
||||
if (device.handleFlip(cmd.flip.bufferIndex, cmd.flip.arg,
|
||||
presentCmdBuffers[imageIndex],
|
||||
|
|
@ -842,6 +847,34 @@ int main(int argc, const char *argv[]) {
|
|||
kill(bridge->pusherPid, SIGINT);
|
||||
}
|
||||
|
||||
for (auto fence : inFlightFences) {
|
||||
vkDestroyFence(vkDevice, fence, nullptr);
|
||||
}
|
||||
|
||||
vkDestroySemaphore(vkDevice, presentCompleteSemaphore, nullptr);
|
||||
vkDestroySemaphore(vkDevice, renderCompleteSemaphore, nullptr);
|
||||
vkDestroyCommandPool(vkDevice, commandPool, nullptr);
|
||||
|
||||
for (auto &handles : swapchainImageHandles) {
|
||||
for (auto handle : handles) {
|
||||
vkDestroyImage(vkDevice, handle, nullptr);
|
||||
}
|
||||
}
|
||||
for (auto &handles : swapchainBufferHandles) {
|
||||
for (auto handle : handles) {
|
||||
vkDestroyBuffer(vkDevice, handle, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
vkDestroySwapchainKHR(vkDevice, swapchain, nullptr);
|
||||
|
||||
for (auto handle : swapchainImages) {
|
||||
vkDestroyImage(vkDevice, handle, nullptr);
|
||||
}
|
||||
|
||||
vkDestroyDevice(vkDevice, nullptr);
|
||||
vkDestroyInstance(vkInstance, nullptr);
|
||||
|
||||
amdgpu::bridge::destroyShmCommandBuffer(bridge);
|
||||
amdgpu::bridge::unlinkShm(cmdBridgeName);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue