- hook up the software renderer
This commit is contained in:
parent
a3c21e0b01
commit
96547713d9
6 changed files with 95 additions and 16 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue