diff --git a/base/vulkanbuffer.hpp b/base/vulkanbuffer.hpp index 7148b9be..f255828a 100644 --- a/base/vulkanbuffer.hpp +++ b/base/vulkanbuffer.hpp @@ -89,6 +89,19 @@ namespace vk descriptor.range = size; } + /** + * Copies the specified data to the mapped buffer + * + * @param data Pointer to the data to copy + * @param size Size of the data to copy in machine units + * + */ + void copyTo(void* data, VkDeviceSize size) + { + assert(mapped); + memcpy(mapped, data, size); + } + /** * Flush a memory range of the buffer to make it visible to the device *