| 28 | }}; |
| 29 | |
| 30 | VkMemoryPropertyFlags GetMemoryPropertyFlags(VulkanMemoryManager::ResourceType resourceType, |
| 31 | std::optional<VkMemoryPropertyFlags> & fallbackTypeBits) |
| 32 | { |
| 33 | switch (resourceType) |
| 34 | { |
| 35 | case VulkanMemoryManager::ResourceType::Geometry: |
| 36 | fallbackTypeBits = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; |
| 37 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; |
| 38 | |
| 39 | case VulkanMemoryManager::ResourceType::Staging: |
| 40 | // No fallback. |
| 41 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; |
| 42 | |
| 43 | case VulkanMemoryManager::ResourceType::Uniform: |
| 44 | // No fallback. |
| 45 | return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; |
| 46 | |
| 47 | case VulkanMemoryManager::ResourceType::Image: |
| 48 | // No fallback. |
| 49 | return VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; |
| 50 | |
| 51 | case VulkanMemoryManager::ResourceType::Count: CHECK(false, ()); |
| 52 | } |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | struct LessBlockSize |
| 57 | { |