mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
More vulkan shutdown fixes
This commit is contained in:
parent
ff6fcc9179
commit
d4e1fc8d93
@ -27,6 +27,10 @@ VulkanPushBuffer::VulkanPushBuffer(VulkanContext *vulkan, size_t size) : device_
|
||||
assert(res);
|
||||
}
|
||||
|
||||
VulkanPushBuffer::~VulkanPushBuffer() {
|
||||
assert(buffers_.empty());
|
||||
}
|
||||
|
||||
bool VulkanPushBuffer::AddBuffer() {
|
||||
BufInfo info;
|
||||
|
||||
@ -63,6 +67,15 @@ bool VulkanPushBuffer::AddBuffer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void VulkanPushBuffer::Destroy(VulkanContext *vulkan) {
|
||||
for (BufInfo &info : buffers_) {
|
||||
vulkan->Delete().QueueDeleteBuffer(info.buffer);
|
||||
vulkan->Delete().QueueDeleteDeviceMemory(info.deviceMemory);
|
||||
}
|
||||
|
||||
buffers_.clear();
|
||||
}
|
||||
|
||||
void VulkanPushBuffer::NextBuffer(size_t minSize) {
|
||||
// First, unmap the current memory.
|
||||
Unmap();
|
||||
@ -254,6 +267,7 @@ void VulkanDeviceAllocator::Free(VkDeviceMemory deviceMemory, size_t offset) {
|
||||
|
||||
// Okay, now enqueue. It's valid.
|
||||
FreeInfo *info = new FreeInfo(this, deviceMemory, offset);
|
||||
// Dispatches a call to ExecuteFree on the next delete round.
|
||||
vulkan_->Delete().QueueCallback(&DispatchFree, info);
|
||||
}
|
||||
|
||||
|
@ -23,19 +23,9 @@ class VulkanPushBuffer {
|
||||
|
||||
public:
|
||||
VulkanPushBuffer(VulkanContext *vulkan, size_t size);
|
||||
~VulkanPushBuffer();
|
||||
|
||||
~VulkanPushBuffer() {
|
||||
assert(buffers_.empty());
|
||||
}
|
||||
|
||||
void Destroy(VulkanContext *vulkan) {
|
||||
for (BufInfo &info : buffers_) {
|
||||
vulkan->Delete().QueueDeleteBuffer(info.buffer);
|
||||
vulkan->Delete().QueueDeleteDeviceMemory(info.deviceMemory);
|
||||
}
|
||||
|
||||
buffers_.clear();
|
||||
}
|
||||
void Destroy(VulkanContext *vulkan);
|
||||
|
||||
void Reset() { offset_ = 0; }
|
||||
|
||||
|
@ -162,6 +162,7 @@ GPU_Vulkan::~GPU_Vulkan() {
|
||||
delete textureCacheVulkan_;
|
||||
delete pipelineManager_;
|
||||
delete shaderManagerVulkan_;
|
||||
delete framebufferManagerVulkan_;
|
||||
}
|
||||
|
||||
void GPU_Vulkan::CheckGPUFeatures() {
|
||||
|
Loading…
Reference in New Issue
Block a user