| 14996 | #endif // VMA_MEMORY_BUDGET |
| 14997 | |
| 14998 | void VmaAllocator_T::FillAllocation(VmaAllocation hAllocation, uint8_t pattern) |
| 14999 | { |
| 15000 | if(VMA_DEBUG_INITIALIZE_ALLOCATIONS && |
| 15001 | hAllocation->IsMappingAllowed() && |
| 15002 | (m_MemProps.memoryTypes[hAllocation->GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) |
| 15003 | { |
| 15004 | void* pData = VMA_NULL; |
| 15005 | VkResult res = Map(hAllocation, &pData); |
| 15006 | if(res == VK_SUCCESS) |
| 15007 | { |
| 15008 | memset(pData, (int)pattern, (size_t)hAllocation->GetSize()); |
| 15009 | FlushOrInvalidateAllocation(hAllocation, 0, VK_WHOLE_SIZE, VMA_CACHE_FLUSH); |
| 15010 | Unmap(hAllocation); |
| 15011 | } |
| 15012 | else |
| 15013 | { |
| 15014 | VMA_ASSERT(0 && "VMA_DEBUG_INITIALIZE_ALLOCATIONS is enabled, but couldn't map memory to fill allocation."); |
| 15015 | } |
| 15016 | } |
| 15017 | } |
| 15018 | |
| 15019 | uint32_t VmaAllocator_T::GetGpuDefragmentationMemoryTypeBits() |
| 15020 | { |
no test coverage detected