#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 552 of file allocator_vk.cc.
553 auto count = memory_properties_.memoryHeapCount;
554 std::vector<VmaBudget> budgets(count);
555 vmaGetHeapBudgets(allocator_.get(), budgets.data());
556 size_t total_usage = 0;
557 for (
auto i = 0u; i < count; i++) {
558 const VmaBudget& budget = budgets[i];
559 total_usage += budget.usage;
561 return Bytes{
static_cast<double>(total_usage)};
AllocationSize< 1u > Bytes
◆ 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 180 of file allocator_vk.cc.
183 int32_t type_index = -1;
184 vk::MemoryPropertyFlagBits required_properties =
185 vk::MemoryPropertyFlagBits::eDeviceLocal;
187 const uint32_t memory_count = memory_properties.memoryTypeCount;
188 for (uint32_t memory_index = 0; memory_index < memory_count; ++memory_index) {
189 const uint32_t memory_type_bits = (1 << memory_index);
190 const bool is_required_memory_type =
191 memory_type_bits_requirement & memory_type_bits;
193 const auto properties =
194 memory_properties.memoryTypes[memory_index].propertyFlags;
195 const bool has_required_properties =
196 (properties & required_properties) == required_properties;
198 if (is_required_memory_type && has_required_properties) {
199 return static_cast<int32_t
>(memory_index);
Referenced by impeller::testing::TEST().
◆ ToVKImageUsageFlags()
Definition at line 206 of file allocator_vk.cc.
211 vk::ImageUsageFlags vk_usage;
218 if (supports_memoryless_textures) {
219 vk_usage |= vk::ImageUsageFlagBits::eTransientAttachment;
226 vk_usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
228 vk_usage |= vk::ImageUsageFlagBits::eColorAttachment;
229 vk_usage |= vk::ImageUsageFlagBits::eInputAttachment;
234 vk_usage |= vk::ImageUsageFlagBits::eSampled;
238 vk_usage |= vk::ImageUsageFlagBits::eStorage;
244 vk_usage |= vk::ImageUsageFlagBits::eTransferSrc |
245 vk::ImageUsageFlagBits::eTransferDst;
constexpr bool PixelFormatIsDepthStencil(PixelFormat format)
References impeller::PixelFormatIsDepthStencil().
Referenced by impeller::testing::TEST().
◆ ContextVK
The documentation for this class was generated from the following files: