MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / FillAllocation

Method FillAllocation

include/vk_mem_alloc.h:14998–15017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14996#endif // VMA_MEMORY_BUDGET
14997
14998void 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
15019uint32_t VmaAllocator_T::GetGpuDefragmentationMemoryTypeBits()
15020{

Callers 1

Calls 4

IsMappingAllowedMethod · 0.80
MapClass · 0.50
GetMemoryTypeIndexMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected