mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
51 lines
909 B
C++
51 lines
909 B
C++
#pragma once
|
|
|
|
#include "graphics/Volatile.h"
|
|
#include "modules/graphics/StreamBuffer.h"
|
|
#include "graphics/Graphics.h"
|
|
|
|
#include "VulkanWrapper.h"
|
|
|
|
namespace love
|
|
{
|
|
namespace graphics
|
|
{
|
|
namespace vulkan
|
|
{
|
|
|
|
class Graphics;
|
|
|
|
class StreamBuffer
|
|
: public love::graphics::StreamBuffer
|
|
, public graphics::Volatile
|
|
{
|
|
public:
|
|
StreamBuffer(graphics::Graphics *gfx, 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;
|
|
|
|
void nextFrame() override;
|
|
|
|
ptrdiff_t getHandle() const override;
|
|
|
|
private:
|
|
Graphics *vgfx = nullptr;
|
|
VmaAllocator allocator;
|
|
VmaAllocation allocation;
|
|
VmaAllocationInfo allocInfo;
|
|
VkBuffer buffer = VK_NULL_HANDLE;
|
|
size_t usedGPUMemory;
|
|
|
|
};
|
|
|
|
} // vulkan
|
|
} // graphics
|
|
} // love
|