{
vkFreeMemory(vk_device, gpu_memory, 0);
}
+
+bool vku_write_memory(VkDeviceMemory gpu_mem, int size, void *data)
+{
+ uint8_t *pdata;
+ VkResult res = vkMapMemory(vk_device, gpu_mem, 0, size, 0, (void **)&pdata);
+ if(res != VK_SUCCESS) {
+ fprintf(stderr, "Failed to map memory to write data.\n");
+ return false;
+ }
+
+ memcpy(pdata, data, size);
+ vkUnmapMemory(vk_device, gpu_mem);
+
+ return true;
+}