mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Generalize handling of heap avoid flags in Vulkan and VMA Allocators
(cherry picked from commit 7c49b044d37ff65599470103d360b8d46045bfb5)
This commit is contained in:
parent
6d41dae922
commit
813767feea
2 changed files with 4 additions and 4 deletions
|
@ -74,6 +74,8 @@ uint32 FindMemoryTypeIndex( const uint32 memoryTypeBits, const vulkanMemoryUsage
|
|||
break;
|
||||
case VULKAN_MEMORY_USAGE_CPU_ONLY:
|
||||
required |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||
// SRS - Make sure memory type does not have VK_MEMORY_HEAP_MULTI_INSTANCE_BIT set, otherwise get validation errors when mapping memory
|
||||
avoid |= VK_MEMORY_HEAP_MULTI_INSTANCE_BIT;
|
||||
break;
|
||||
case VULKAN_MEMORY_USAGE_CPU_TO_GPU:
|
||||
required |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
|
|
|
@ -5253,14 +5253,10 @@ VkResult vmaFindMemoryTypeIndex(
|
|||
case VMA_MEMORY_USAGE_CPU_TO_GPU:
|
||||
requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
|
||||
// SRS - Make sure memory type does not have VK_MEMORY_HEAP_MULTI_INSTANCE_BIT set, otherwise get validation errors when mapping memory
|
||||
avoidFlags |= VK_MEMORY_HEAP_MULTI_INSTANCE_BIT;
|
||||
break;
|
||||
case VMA_MEMORY_USAGE_GPU_TO_CPU:
|
||||
requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
preferredFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
|
||||
// SRS - Make sure memory type does not have VK_MEMORY_HEAP_MULTI_INSTANCE_BIT set, otherwise get validation errors when mapping memory
|
||||
avoidFlags |= VK_MEMORY_HEAP_MULTI_INSTANCE_BIT;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -5269,6 +5265,8 @@ VkResult vmaFindMemoryTypeIndex(
|
|||
if( ( pMemoryRequirements->flags & VMA_MEMORY_REQUIREMENT_PERSISTENT_MAP_BIT ) != 0 )
|
||||
{
|
||||
requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
// SRS - Make sure memory type does not have VK_MEMORY_HEAP_MULTI_INSTANCE_BIT set, otherwise get validation errors when mapping memory
|
||||
avoidFlags |= VK_MEMORY_HEAP_MULTI_INSTANCE_BIT;
|
||||
}
|
||||
|
||||
*pMemoryTypeIndex = UINT32_MAX;
|
||||
|
|
Loading…
Reference in a new issue