Adding in sandbox + Logger upgrade #80

Merged
burkkyy merged 10 commits from sandbox into main 2026-10-06 01:20:21 -07:00
2 changed files with 4 additions and 8 deletions
Showing only changes of commit f6f4f8b7c9 - Show all commits
+2 -5
View File
@@ -36,17 +36,14 @@ Buffer::~Buffer() {
vmaDestroyBuffer(this->device.getAllocator(), this->buffer, this->allocation); vmaDestroyBuffer(this->device.getAllocator(), this->buffer, this->allocation);
} }
// VMA always maps the whole allocation, so `size` only exists to keep the vk::Result Buffer::map() {
// interface; `offset` is applied to the returned pointer.
vk::Result Buffer::map(vk::DeviceSize size, vk::DeviceSize offset) {
SOPHIA_ASSERT(buffer && allocation, "Called map on buffer before create"); SOPHIA_ASSERT(buffer && allocation, "Called map on buffer before create");
(void)size;
void* base = nullptr; void* base = nullptr;
vk::Result result = static_cast<vk::Result>( vk::Result result = static_cast<vk::Result>(
vmaMapMemory(this->device.getAllocator(), this->allocation, &base)); vmaMapMemory(this->device.getAllocator(), this->allocation, &base));
if (result == vk::Result::eSuccess) { if (result == vk::Result::eSuccess) {
this->mapped = static_cast<char*>(base) + offset; this->mapped = base;
} }
return result; return result;
} }
+2 -3
View File
@@ -19,8 +19,7 @@ class Buffer {
vk::DeviceSize minOffsetAlignment = 1); vk::DeviceSize minOffsetAlignment = 1);
~Buffer(); ~Buffer();
vk::Result map(vk::DeviceSize size = VK_WHOLE_SIZE, vk::Result map();
vk::DeviceSize offset = 0);
void unmap(); void unmap();
void writeToBuffer(void* data, vk::DeviceSize size = VK_WHOLE_SIZE, void writeToBuffer(void* data, vk::DeviceSize size = VK_WHOLE_SIZE,
@@ -41,7 +40,7 @@ class Buffer {
void* getMappedMemory() const { return mapped; } void* getMappedMemory() const { return mapped; }
uint32_t getInstanceCount() const { return instanceCount; } uint32_t getInstanceCount() const { return instanceCount; }
vk::DeviceSize getInstanceSize() const { return instanceSize; } vk::DeviceSize getInstanceSize() const { return instanceSize; }
vk::DeviceSize getAlignmentSize() const { return instanceSize; } vk::DeviceSize getAlignmentSize() const { return alignmentSize; }
vk::BufferUsageFlags getUsageFlags() const { return usageFlags; } vk::BufferUsageFlags getUsageFlags() const { return usageFlags; }
vk::MemoryPropertyFlags getMemoryPropertyFlags() const { vk::MemoryPropertyFlags getMemoryPropertyFlags() const {
return memoryPropertyFlags; return memoryPropertyFlags;