From 8ee924299c72b6550f89fdf08698160f84401685 Mon Sep 17 00:00:00 2001 From: think3r Date: Thu, 25 May 2023 17:02:35 +0800 Subject: [PATCH] fix: add `HOST_COHERENT` memoryProperty when allocate memory for `VkImage` (#88) --- tutorial06_texture/app/src/main/cpp/VulkanMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial06_texture/app/src/main/cpp/VulkanMain.cpp b/tutorial06_texture/app/src/main/cpp/VulkanMain.cpp index c051486..416fc44 100644 --- a/tutorial06_texture/app/src/main/cpp/VulkanMain.cpp +++ b/tutorial06_texture/app/src/main/cpp/VulkanMain.cpp @@ -446,7 +446,7 @@ VkResult LoadTextureFromFile(const char* filePath, vkGetImageMemoryRequirements(device.device_, tex_obj->image, &mem_reqs); mem_alloc.allocationSize = mem_reqs.size; VK_CHECK(AllocateMemoryTypeFromProperties(mem_reqs.memoryTypeBits, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &mem_alloc.memoryTypeIndex)); CALL_VK(vkAllocateMemory(device.device_, &mem_alloc, nullptr, &tex_obj->mem)); CALL_VK(vkBindImageMemory(device.device_, tex_obj->image, tex_obj->mem, 0));