From: Jean-Philippe Bruyère Date: Sat, 12 May 2018 02:51:43 +0000 (+0200) Subject: image mapping with vma + typo X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=c73beac894a8d1f6bcbd21c103bf4db613420f10;p=jp%2Fvkhelpers.git image mapping with vma + typo --- diff --git a/src/vkh_app.c b/src/vkh_app.c index 1ce465a..95a1083 100644 --- a/src/vkh_app.c +++ b/src/vkh_app.c @@ -21,7 +21,7 @@ */ #include "vkh_app.h" -#define ENGINE_NAME "vkheplers" +#define ENGINE_NAME "vkhelpers" #define ENGINE_VERSION 1 VkhApp vkh_app_create (const char* app_name, int ext_count, const char* extentions[]) { diff --git a/src/vkh_image.c b/src/vkh_image.c index acd6ba7..821eb73 100644 --- a/src/vkh_image.c +++ b/src/vkh_image.c @@ -223,12 +223,10 @@ void vkh_image_destroy(VkhImage img) } void* vkh_image_map (VkhImage img) { - VkImageSubresource subRes = { .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT}; - VkSubresourceLayout subResLayout; - - vkGetImageSubresourceLayout (img->pDev->dev, img->image, &subRes, &subResLayout); - return (void*)img->allocInfo.pMappedData + subResLayout.offset; + void* data; + vmaMapMemory(img->pDev->allocator, img->alloc, &data); + return data; } void vkh_image_unmap (VkhImage img) { - //vkUnmapMemory (img->pDev->dev, img->memory); + vmaUnmapMemory(img->pDev->allocator, img->alloc); }