| 7367 | } |
| 7368 | |
| 7369 | void VmaBlockBufferImageGranularity::FreePages(VkDeviceSize offset, VkDeviceSize size) |
| 7370 | { |
| 7371 | if (!IsEnabled()) |
| 7372 | return; |
| 7373 | |
| 7374 | uint32_t startPage = GetStartPage(offset); |
| 7375 | --m_RegionInfo[startPage].allocCount; |
| 7376 | if (m_RegionInfo[startPage].allocCount == 0) |
| 7377 | m_RegionInfo[startPage].allocType = VMA_SUBALLOCATION_TYPE_FREE; |
| 7378 | uint32_t endPage = GetEndPage(offset, size); |
| 7379 | if (startPage != endPage) |
| 7380 | { |
| 7381 | --m_RegionInfo[endPage].allocCount; |
| 7382 | if (m_RegionInfo[endPage].allocCount == 0) |
| 7383 | m_RegionInfo[endPage].allocType = VMA_SUBALLOCATION_TYPE_FREE; |
| 7384 | } |
| 7385 | } |
| 7386 | |
| 7387 | void VmaBlockBufferImageGranularity::Clear() |
| 7388 | { |