some work on drawQuads (not fully working yet)

This commit is contained in:
niki
2022-06-25 23:02:13 +02:00
parent efdc2b8ee2
commit 7f894e5bf7
7 changed files with 315 additions and 61 deletions
+5 -7
View File
@@ -1,5 +1,6 @@
#include "graphics/Buffer.h"
#include <vulkan/vulkan.h>
#include "vk_mem_alloc.h"
namespace love {
@@ -7,7 +8,7 @@ namespace love {
namespace vulkan {
class Buffer : public love::graphics::Buffer {
public:
Buffer(love::graphics::Graphics* gfx, const Settings& settings, const std::vector<DataDeclaration>& format, const void* data, size_t size, size_t arraylength);
Buffer(VmaAllocator allocator, love::graphics::Graphics* gfx, const Settings& settings, const std::vector<DataDeclaration>& format, const void* data, size_t size, size_t arraylength);
virtual ~Buffer();
void* map(MapType map, size_t offset, size_t size) override;
@@ -18,18 +19,15 @@ namespace love {
return (ptrdiff_t) buffer; // todo ?
}
ptrdiff_t getTexelBufferHandle() const override {
throw love::Exception("unimplemented Buffer::getTexelBufferHandle");
return (ptrdiff_t) nullptr; // todo ?
}
private:
VkDevice device;
VkPhysicalDevice physicalDevice;
// todo use a staging buffer for improved performance
VkBuffer buffer;
VkDeviceMemory bufferMemory;
void* mappedMemory;
VmaAllocation allocation;
VmaAllocationInfo allocInfo;
};
}
}