]> O.S.I.I.S - jp/vkhelpers.git/commitdiff
image mapping with vma + typo
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 12 May 2018 02:51:43 +0000 (04:51 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 12 May 2018 02:51:43 +0000 (04:51 +0200)
src/vkh_app.c
src/vkh_image.c

index 1ce465aa4c931dd4c152c8292728603f2bd27893..95a1083a345daf97c1a3af5b924c716d15169bd2 100644 (file)
@@ -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[]) {
index acd6ba7dedbefc03ab9e45ff02ad0d837dbf070d..821eb739a79050f56d578b1dbd3dee6b72440cf3 100644 (file)
@@ -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);
 }