From 2f382df218d7e8516dee3b3caccb819a62b571a2 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 11 Sep 2023 17:58:15 +0200 Subject: [PATCH] Fixed signed/unsigned mismatch in FindMemoryPreferences For compatibility with UBSan. Fixes #368 - thanks @markridgewell --- include/vk_mem_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 19a26f2..3cc5880 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -3702,7 +3702,7 @@ static bool FindMemoryPreferences( return false; } // This relies on values of VK_IMAGE_USAGE_TRANSFER* being the same VK_BUFFER_IMAGE_TRANSFER*. - const bool deviceAccess = (bufImgUsage & ~(VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT)) != 0; + const bool deviceAccess = (bufImgUsage & ~static_cast(VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT)) != 0; const bool hostAccessSequentialWrite = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT) != 0; const bool hostAccessRandom = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT) != 0; const bool hostAccessAllowTransferInstead = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT) != 0;