diff --git a/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp b/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp index 2e5b73aecc7..7af8c7d8bef 100644 --- a/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp +++ b/RenderSystems/Vulkan/src/Vao/OgreVulkanVaoManager.cpp @@ -982,9 +982,8 @@ namespace Ogre { // Found one! size_t defaultPoolSize = - std::min( mDefaultPoolSize[vboFlag], - memHeaps[memTypes[*itMemTypeIdx].heapIndex].size - - mUsedHeapMemory[heapIdx] ); + std::min( (VkDeviceSize)mDefaultPoolSize[vboFlag], + memHeaps[heapIdx].size - mUsedHeapMemory[heapIdx] ); poolSize = std::max( defaultPoolSize, sizeBytes ); break; } @@ -1010,14 +1009,13 @@ namespace Ogre { // We didn't try this memory type. Let's check if we can use it // TODO: See comment above about memHeaps[heapIdx].size - const size_t heapIdx = memTypes[memTypes[i].heapIndex].heapIndex; + const size_t heapIdx = memTypes[i].heapIndex; if( mUsedHeapMemory[heapIdx] + poolSize < memHeaps[heapIdx].size ) { // Found one! size_t defaultPoolSize = - std::min( mDefaultPoolSize[vboFlag], - memHeaps[memTypes[heapIdx].heapIndex].size - - mUsedHeapMemory[heapIdx] ); + std::min( (VkDeviceSize)mDefaultPoolSize[vboFlag], + memHeaps[heapIdx].size - mUsedHeapMemory[heapIdx] ); chosenMemoryTypeIdx = static_cast( i ); poolSize = std::max( defaultPoolSize, sizeBytes ); break;