vulkan: fix some memory leaks

This commit is contained in:
niki
2022-07-11 01:13:50 +02:00
parent 7fe2a2d821
commit 0759e8d513
10 changed files with 103 additions and 21 deletions
+7 -2
View File
@@ -1,6 +1,7 @@
#ifndef LOVE_GRAPHICS_VULKAN_STREAMBUFFER_H
#define LOVE_GRAPHICS_VULKAN_STREAMBUFFER_H
#include "graphics/Volatile.h"
#include "modules/graphics/StreamBuffer.h"
#include "vulkan/vulkan.h"
@@ -9,11 +10,15 @@
namespace love {
namespace graphics {
namespace vulkan {
class StreamBuffer : public love::graphics::StreamBuffer {
class StreamBuffer : public love::graphics::StreamBuffer, public graphics::Volatile {
public:
StreamBuffer(VmaAllocator allocator, BufferUsage mode, size_t size);
virtual ~StreamBuffer();
virtual bool loadVolatile() override;
virtual void unloadVolatile() override;
MapInfo map(size_t minsize) override;
size_t unmap(size_t usedSize) override;
void markUsed(size_t usedSize) override;
@@ -28,7 +33,7 @@ namespace love {
VmaAllocator allocator;
VmaAllocation allocation;
VmaAllocationInfo allocInfo;
VkBuffer buffer;
VkBuffer buffer = VK_NULL_HANDLE;
size_t usedGPUMemory;
};