- hook up the software renderer

This commit is contained in:
Magnus Norddahl 2019-02-27 15:37:37 +01:00
commit 96547713d9
6 changed files with 95 additions and 16 deletions

View file

@ -78,6 +78,9 @@ public:
int height = 0;
int mipLevels = 1;
void *Map(size_t offset, size_t size);
void Unmap();
private:
VulkanDevice *device = nullptr;
VmaAllocation allocation;
@ -881,6 +884,18 @@ inline VulkanImage::~VulkanImage()
vmaDestroyImage(device->allocator, image, allocation);
}
inline void *VulkanImage::Map(size_t offset, size_t size)
{
void *data;
VkResult result = vmaMapMemory(device->allocator, allocation, &data);
return (result == VK_SUCCESS) ? data : nullptr;
}
inline void VulkanImage::Unmap()
{
vmaUnmapMemory(device->allocator, allocation);
}
/////////////////////////////////////////////////////////////////////////////
inline VulkanImageView::VulkanImageView(VulkanDevice *device, VkImageView view) : device(device), view(view)