#include <allocator_vk.h>
Definition at line 19 of file allocator_vk.h.
◆ ~AllocatorVK()
| impeller::AllocatorVK::~AllocatorVK |
( |
| ) |
|
|
overridedefault |
◆ DebugGetHeapUsage()
| Bytes impeller::AllocatorVK::DebugGetHeapUsage |
( |
| ) |
const |
|
overridevirtual |
Reimplemented from impeller::Allocator.
Definition at line 537 of file allocator_vk.cc.
538 auto count = memory_properties_.memoryHeapCount;
539 std::vector<VmaBudget> budgets(count);
540 vmaGetHeapBudgets(allocator_.get(), budgets.data());
541 size_t total_usage = 0;
542 for (
auto i = 0u; i < count; i++) {
543 const VmaBudget& budget = budgets[i];
544 total_usage += budget.usage;
546 return Bytes{
static_cast<double>(total_usage)};
◆ FindMemoryTypeIndex()
| int32_t impeller::AllocatorVK::FindMemoryTypeIndex |
( |
uint32_t |
memory_type_bits_requirement, |
|
|
vk::PhysicalDeviceMemoryProperties & |
memory_properties |
|
) |
| |
|
static |
Select a matching memory type for the given [memory_type_bits_requirement], or -1 if none is found.
This only returns memory types with deviceLocal allocations.
Definition at line 175 of file allocator_vk.cc.
178 int32_t type_index = -1;
179 vk::MemoryPropertyFlagBits required_properties =
180 vk::MemoryPropertyFlagBits::eDeviceLocal;
182 const uint32_t memory_count = memory_properties.memoryTypeCount;
183 for (uint32_t memory_index = 0; memory_index < memory_count; ++memory_index) {
184 const uint32_t memory_type_bits = (1 << memory_index);
185 const bool is_required_memory_type =
186 memory_type_bits_requirement & memory_type_bits;
188 const auto properties =
189 memory_properties.memoryTypes[memory_index].propertyFlags;
190 const bool has_required_properties =
191 (properties & required_properties) == required_properties;
193 if (is_required_memory_type && has_required_properties) {
194 return static_cast<int32_t
>(memory_index);
Referenced by impeller::ImportVKDeviceMemoryFromAndroidHarwareBuffer(), and impeller::testing::TEST().
◆ ToVKImageUsageFlags()
Definition at line 201 of file allocator_vk.cc.
206 vk::ImageUsageFlags vk_usage;
213 if (supports_memoryless_textures) {
214 vk_usage |= vk::ImageUsageFlagBits::eTransientAttachment;
221 vk_usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
223 vk_usage |= vk::ImageUsageFlagBits::eColorAttachment;
224 vk_usage |= vk::ImageUsageFlagBits::eInputAttachment;
229 vk_usage |= vk::ImageUsageFlagBits::eSampled;
233 vk_usage |= vk::ImageUsageFlagBits::eStorage;
239 vk_usage |= vk::ImageUsageFlagBits::eTransferSrc |
240 vk::ImageUsageFlagBits::eTransferDst;
References impeller::PixelFormatIsDepthStencil().
Referenced by impeller::testing::TEST().
◆ ContextVK
The documentation for this class was generated from the following files: