Basic GUI

This commit is contained in:
Guillaume Meunier
2024-01-28 11:33:35 +01:00
parent a7bd88aa6c
commit d84095e1ea
42 changed files with 1970 additions and 363 deletions
+5 -2
View File
@@ -23,6 +23,7 @@
#include <fastgltf/types.hpp>
#include <fastgltf/tools.hpp>
#include "vk/allocation.h"
#include "utils/alignment.h"
class gpu_buffer
{
@@ -33,7 +34,7 @@ class gpu_buffer
size_t add(size_t alignment, const void * data_to_add, size_t size)
{
size_t offset = ((bytes.size() + alignment - 1) / alignment) * alignment;
size_t offset = utils::align_up(alignment, bytes.size());
bytes.resize(offset + size);
@@ -121,7 +122,9 @@ public:
.usage = usage},
VmaAllocationCreateInfo{
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT,
.usage = VMA_MEMORY_USAGE_AUTO}};
.usage = VMA_MEMORY_USAGE_AUTO},
"gpu_buffer::copy_to_gpu"
};
memcpy(gpu_buffer.map(), bytes.data(), bytes.size());
gpu_buffer.unmap();