#include "state_tracker/device_memory_state.h"
#include <algorithm>
BufferRange;
MemoryRange;
BoundMemoryRange;
BoundRanges;
DeviceMemoryState;
static VkExternalMemoryHandleTypeFlags GetExportHandleTypes(const VkMemoryAllocateInfo *p_alloc_info) { … }
static std::optional<VkExternalMemoryHandleTypeFlagBits> GetImportHandleType(const VkMemoryAllocateInfo *p_alloc_info) { … }
static bool IsMultiInstance(const VkMemoryAllocateInfo *p_alloc_info, const VkMemoryHeap &memory_heap,
uint32_t physical_device_count) { … }
#ifdef VK_USE_PLATFORM_METAL_EXT
static bool GetMetalExport(const VkMemoryAllocateInfo *info) {
bool retval = false;
auto export_metal_object_info = vku::FindStructInPNextChain<VkExportMetalObjectCreateInfoEXT>(info->pNext);
while (export_metal_object_info) {
if (export_metal_object_info->exportObjectType == VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT) {
retval = true;
break;
}
export_metal_object_info = vku::FindStructInPNextChain<VkExportMetalObjectCreateInfoEXT>(export_metal_object_info->pNext);
}
return retval;
}
#endif
namespace vvl {
DeviceMemory::DeviceMemory(VkDeviceMemory handle, const VkMemoryAllocateInfo *allocate_info, uint64_t fake_address,
const VkMemoryType &memory_type, const VkMemoryHeap &memory_heap,
std::optional<DedicatedBinding> &&dedicated_binding, uint32_t physical_device_count)
: … { … }
}
void vvl::BindableLinearMemoryTracker::BindMemory(StateObject *parent, std::shared_ptr<vvl::DeviceMemory> &mem_state,
VkDeviceSize memory_offset, VkDeviceSize resource_offset, VkDeviceSize size) { … }
DeviceMemoryState vvl::BindableLinearMemoryTracker::GetBoundMemoryStates() const { … }
BoundMemoryRange vvl::BindableLinearMemoryTracker::GetBoundMemoryRange(const MemoryRange &range) const { … }
BoundRanges vvl::BindableLinearMemoryTracker::GetBoundRanges(const BufferRange &ranges_bounds,
const std::vector<BufferRange> &ranges) const { … }
unsigned vvl::BindableSparseMemoryTracker::CountDeviceMemory(VkDeviceMemory memory) const { … }
bool vvl::BindableSparseMemoryTracker::HasFullRangeBound() const { … }
void vvl::BindableSparseMemoryTracker::BindMemory(StateObject *parent, std::shared_ptr<vvl::DeviceMemory> &mem_state,
VkDeviceSize memory_offset, VkDeviceSize resource_offset, VkDeviceSize size) { … }
BoundMemoryRange vvl::BindableSparseMemoryTracker::GetBoundMemoryRange(const MemoryRange &range) const { … }
BoundRanges vvl::BindableSparseMemoryTracker::GetBoundRanges(const BufferRange &ranges_bounds,
const std::vector<BufferRange> &buffer_ranges) const { … }
DeviceMemoryState vvl::BindableSparseMemoryTracker::GetBoundMemoryStates() const { … }
vvl::BindableMultiplanarMemoryTracker::BindableMultiplanarMemoryTracker(const VkMemoryRequirements *requirements, uint32_t num_planes)
: … { … }
unsigned vvl::BindableMultiplanarMemoryTracker::CountDeviceMemory(VkDeviceMemory memory) const { … }
bool vvl::BindableMultiplanarMemoryTracker::HasFullRangeBound() const { … }
void vvl::BindableMultiplanarMemoryTracker::BindMemory(StateObject *parent, std::shared_ptr<vvl::DeviceMemory> &mem_state,
VkDeviceSize memory_offset, VkDeviceSize resource_offset, VkDeviceSize size) { … }
BoundMemoryRange vvl::BindableMultiplanarMemoryTracker::GetBoundMemoryRange(const MemoryRange &range) const { … }
DeviceMemoryState vvl::BindableMultiplanarMemoryTracker::GetBoundMemoryStates() const { … }
std::pair<VkDeviceMemory, MemoryRange> vvl::Bindable::GetResourceMemoryOverlap(
const MemoryRange &memory_region, const Bindable *other_resource,
const MemoryRange &other_memory_region) const { … }
VkDeviceSize vvl::Bindable::GetFakeBaseAddress() const { … }
void vvl::Bindable::CacheInvalidMemory() const { … }