UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VulkanMemory.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 VulkanMemory.h: Vulkan Memory RHI definitions.
5=============================================================================*/
6
7#pragma once
8
9#include "Containers/Map.h"
10#include "Misc/ScopeRWLock.h"
12#include "VulkanConfiguration.h"
13#include "VulkanThirdParty.h"
14
15#define UE_API VULKANRHI_API
16
17//enable to store FILE/LINE, and optionally a stacktrace via r.vulkan.backtrace
18#if !UE_BUILD_SHIPPING
19#define VULKAN_MEMORY_TRACK 1
20#else
21#define VULKAN_MEMORY_TRACK 0
22#endif
23
24
25#define VULKAN_MEMORY_LOW_PRIORITY 0.f
26#define VULKAN_MEMORY_MEDIUM_PRIORITY 0.5f
27#define VULKAN_MEMORY_HIGHER_PRIORITY 0.75f
28#define VULKAN_MEMORY_HIGHEST_PRIORITY 1.f
29
32class FVulkanDevice;
33class FVulkanQueue;
35class FVulkanTexture;
36
38
41
42#if !VULKAN_OBJECT_TRACKING
43#define VULKAN_TRACK_OBJECT_CREATE(Type, Ptr) do{}while(0)
44#define VULKAN_TRACK_OBJECT_DELETE(Type, Ptr) do{}while(0)
45#else
46#define VULKAN_TRACK_OBJECT_CREATE(Type, Ptr) do{TVulkanTrackBase<Type>::Add(Ptr);}while(0)
47#define VULKAN_TRACK_OBJECT_DELETE(Type, Ptr) do{TVulkanTrackBase<Type>::Remove(Ptr);}while(0)
48
49template<typename Type>
51{
52public:
53
55 static TSet<Type*> Objects;
56 template<typename Callback>
57 static uint32 CollectAll(Callback CB)
58 {
59 uint32 Count = 0;
60 FScopeLock L(&Lock);
61 TArray<Type*> Temp;
62 for(Type* Object : Objects)
63 {
64 Object->DumpMemory(CB);
65 Count++;
66 }
67 return Count;
68 }
69 static void Add(Type* Object)
70 {
71 FScopeLock L(&Lock);
72 Objects.Add(Object);
73
74 }
75 static void Remove(Type* Object)
76 {
77 FScopeLock L(&Lock);
78 Objects.Remove(Object);
79 }
80};
81
82template<typename Type>
83FCriticalSection TVulkanTrackBase<Type>::Lock;
84template<typename Type>
85TSet<Type*> TVulkanTrackBase<Type>::Objects;
86#endif
87
88namespace VulkanRHI
89{
90 class FFenceManager;
91 class FDeviceMemoryManager; // Manager of low level vulkan memory allocations
92 class FDeviceMemoryAllocation; // A single low level allocation
93 class FVulkanSubresourceAllocator; // handles suballocation of one allocation into many
94 class FVulkanResourceHeap; // has multiple suballocators. On resource heap per memory type
95 class FMemoryManager; // entry point for everything. Contains all heaps. has a small allocator for small stuff.
96 struct FRange; // Helper class for suballocation (this is effectively the allocator implementation)
97 class FVulkanAllocation; // External handle to any allocation handled by FMemoryManager
98 struct FVulkanAllocationInternal; // Internal representation mirroring vulkan allocation
99 struct FResourceHeapStats;
100}
101
102
104{
105public:
106 virtual bool CanMove() const { return false; }
107 virtual bool CanEvict() const { return false; }
108 virtual void Evict(FVulkanDevice& Device, const FVulkanContextArray& Contexts) { checkNoEntry(); }
109 virtual void Move(FVulkanDevice& Device, const FVulkanContextArray& Contexts, VulkanRHI::FVulkanAllocation& Allocation) { checkNoEntry(); }
110 virtual FVulkanTexture* GetEvictableTexture() { return nullptr; }
111};
112
113
115{
117 void* Data;
118 int32 SizeOrLine; //negative indicates a stack trace, Positive line number
119};
120
122{
123 None, // acquire next image on frame start
124 DelayAcquire, // acquire next image just before presenting, rendering is done to intermediate image which is copied to real backbuffer
125};
126
128
130
131namespace VulkanRHI
132{
133 enum
134 {
136 };
137
146
166
167 enum class EType
168 {
169 Image,
170 Buffer,
171 };
172
173
174 // An Allocation off a Device Heap. Lowest level of allocations and bounded by VkPhysicalDeviceLimits::maxMemoryAllocationCount.
176 {
177 public:
179 : Size(0)
182 , MappedPointer(nullptr)
183 , MemoryTypeIndex(0)
184 , bCanBeMapped(0)
185 , bIsCoherent(0)
186 , bIsCached(0)
189 {
190 }
191
193 void Unmap();
194
195 inline bool CanBeMapped() const
196 {
197 return bCanBeMapped != 0;
198 }
199
200 inline bool IsMapped() const
201 {
202 return !!MappedPointer;
203 }
204
205 inline void* GetMappedPointer()
206 {
207 check(IsMapped());
208 return MappedPointer;
209 }
210
211 inline bool IsCoherent() const
212 {
213 return bIsCoherent != 0;
214 }
215
218
220 {
221 return Handle;
222 }
223
224 inline VkDeviceSize GetSize() const
225 {
226 return Size;
227 }
228
230 {
231 return MemoryTypeIndex;
232 }
233
234 protected:
246
247
248#if VULKAN_MEMORY_TRACK
250#endif
252
254 };
255
257 {
260
262 {
263 return MemoryTypeIndex == Other.MemoryTypeIndex && BlockSize == Other.BlockSize;
264 }
265 };
266
271
283
284
285
286 // Manager of Device Heap Allocations. Calling Alloc/Free is expensive!
288 {
290 void UpdateMemoryProperties();
291 public:
294
296
297 void Deinit();
298
300
301 inline bool HasUnifiedMemory() const
302 {
303 return bHasUnifiedMemory;
304 }
305
306 inline bool SupportsMemoryless() const
307 {
308 return bSupportsMemoryless;
309 }
310
312 {
313 return MemoryProperties.memoryTypeCount;
314 }
315
316 bool SupportsMemoryType(VkMemoryPropertyFlags Properties) const;
318
322
323
324 // bCanFail means an allocation failing is not a fatal error, just returns nullptr
325 FDeviceMemoryAllocation* Alloc(bool bCanFail, VkDeviceSize AllocationSize, uint32 MemoryTypeIndex, void* DedicatedAllocateInfo, float Priority, bool bExternal, const char* File, uint32 Line);
326 FDeviceMemoryAllocation* Alloc(bool bCanFail, VkDeviceSize AllocationSize, uint32 MemoryTypeBits, VkMemoryPropertyFlags MemoryPropertyFlags, void* DedicatedAllocateInfo, float Priority, bool bExternal, const char* File, uint32 Line);
327
328 // Sets the Allocation to nullptr
329 void Free(FDeviceMemoryAllocation*& Allocation);
330
331 uint64 GetTotalMemory(bool bGPU) const;
332 VkDeviceSize GetBaseHeapSize(uint32 HeapIndex) const;
333 uint32 GetHeapIndex(uint32 MemoryTypeIndex);
334
335 protected:
336 void FreeInternal(FDeviceMemoryAllocation* Allocation);
337 void TrimMemory(bool bFullTrim);
338 friend class FMemoryManager;
340 void DumpMemory();
341 void PrintMemInfo() const;
342
352
365
367
368 int32 PrimaryHeapIndex; // memory usage of this heap will decide when to evict.
369
371 };
372
373 struct FRange
374 {
377
378 inline bool operator<(const FRange& In) const
379 {
380 return Offset < In.Offset;
381 }
382
383 static void JoinConsecutiveRanges(TArray<FRange>& Ranges);
384
387
389 static int32 AppendAndTryToMerge(TArray<FRange>& Ranges, const FRange& Item);
390
393
395 static void SanityCheck(TArray<FRange>& Ranges);
396
398 static int32 Add(TArray<FRange>& Ranges, const FRange& Item);
399 };
400
412
413
414 // Holds a reference to -any- vulkan gpu allocation
415 // !Intentionally not reference counted
416 // !User must call Free exactly once
418 {
419 public:
422 void Init(EVulkanAllocationType Type, EVulkanAllocationMetaType MetaType, uint64 Handle, uint32 InSize, uint32 AlignedOffset, uint32 AllocatorIndex, uint32 AllocationIndex, uint32 BufferId);
423 void Free(FVulkanDevice& Device);
425 void Reference(const FVulkanAllocation& Other); //point to other, but don't take ownership
426 bool HasAllocation() const;
427
428 void Disown(); //disown & own should be used if ownership is transferred.
429 void Own();
430 bool IsValid() const;
431
438 EVulkanAllocationMetaType MetaType = EVulkanAllocationMetaUnknown;
442
443 static_assert(EVulkanAllocationSize < 128, "Not enough bits to hold EVulkanAllocationType");
444 inline EVulkanAllocationType GetType() const
445 {
446 return (EVulkanAllocationType)Type;
447 }
448 inline void SetType(EVulkanAllocationType InType)
449 {
450 Type = (uint8)InType;
451 }
452
453 //helper functions
454 void* GetMappedPointer(FVulkanDevice* Device);
455 void FlushMappedMemory(FVulkanDevice* Device);
462 void BindImage(FVulkanDevice* Device, VkImage Image);
463 };
464
465
466
468 {
469 enum
470 {
475 EFREEDISCARDED, // if a defrag happens with a pending free, its put into this state, so we can ignore the deferred delete once it happens.
476 };
477
480
481 EVulkanAllocationType Type = EVulkanAllocationEmpty;
482 EVulkanAllocationMetaType MetaType = EVulkanAllocationMetaUnknown;
483
489
491
492#if VULKAN_MEMORY_TRACK
494#endif
495#if VULKAN_USE_LLM
499#endif
500 };
501
502
503
505 {
506 friend class FMemoryManager;
508 public:
512
513
516
518
519 void Destroy(FVulkanDevice* Device);
521 void Free(FVulkanAllocation& Allocation);
522
523 inline uint32 GetAlignment() const
524 {
525 return Alignment;
526 }
527
528 inline void* GetMappedPointer()
529 {
531 }
532
533 void Flush(VkDeviceSize Offset, VkDeviceSize AllocationSize);
534 void Invalidate(VkDeviceSize Offset, VkDeviceSize AllocationSize);
535 uint32 GetMaxSize() const { return MaxSize; }
536 uint32 GetUsedSize() const { return UsedSize; }
537
538 inline uint32 GetHandleId() const
539 {
540 return BufferId;
541 }
546 EVulkanAllocationType GetType(){ return Type; }
547
550
556 {
557 return BufferId;
558 }
560
561
562 protected:
564 void DumpFullHeap();
566 bool CanDefrag();
567 uint64 EvictToHost(FVulkanDevice& Device, const FVulkanContextArray& Contexts);
568 void SetFreePending(FVulkanAllocation& Allocation);
571
572 uint32 MemoryUsed[EVulkanAllocationMetaSize];
573
574 EVulkanAllocationType Type;
591 bool bIsEvicting = false;
592 bool bLocked = false;
593 bool bIsDefragging = false;
594
598
599 // List of free ranges
601 bool JoinFreeBlocks();
603 {
604 return AllocatorIndex;
605 }
606
607
608#if VULKAN_MEMORY_TRACK
610#endif
614 };
615
616
617 // A set of Device Allocations (Heap Pages) for a specific memory type. This handles pooling allocations inside memory pages to avoid
618 // doing allocations directly off the device's heaps
620 {
621 public:
624
627
628 //void ReleaseFreedPages(bool bImmediately);
629
631 {
632 return Owner;
633 }
634
635 inline bool IsHostCachedSupported() const
636 {
638 }
639
640 inline bool IsLazilyAllocatedSupported() const
641 {
643 }
644
646 {
647 return MemoryTypeIndex;
648 }
649
650 uint64 EvictOne(FVulkanDevice& Device, const FVulkanContextArray& Contexts);
651 void DefragTick(FVulkanDevice& Device, const FVulkanContextArray& Contexts, uint32 Count);
652 void DumpMemory(FResourceHeapStats& Stats);
653
657
658 protected:
659 enum {
661 };
667
671
673
677
681
682 bool TryRealloc(FVulkanAllocation& OutAllocation, FVulkanEvictable* AllocationOwner, EType Type, uint32 Size, uint32 Alignment, EVulkanAllocationMetaType MetaType);
683 bool AllocateResource(FVulkanAllocation& OutAllocation, FVulkanEvictable* AllocationOwner, EType Type, uint32 Size, uint32 Alignment, bool bMapAllocation, bool bForceSeparateAllocation, EVulkanAllocationMetaType MetaType, bool bExternal, const char* File, uint32 Line);
684 bool AllocateDedicatedImage(FVulkanAllocation& OutAllocation, FVulkanEvictable* AllocationOwner, VkImage Image, uint32 Size, uint32 Alignment, EVulkanAllocationMetaType MetaType, bool bExternal, const char* File, uint32 Line);
685
686 friend class FMemoryManager;
688 };
689
695
696
697 // Allocation flags to account for conditions not covered by vkGet*MemoryRequirements or resource usage flags
699 {
700 None = 0x0000,
701
702 HostVisible = 0x0001, // Will be written from CPU, will likely contain the HOST_VISIBLE + HOST_COHERENT flags
703 HostCached = 0x0002, // Will be used for readback, will likely contain the HOST_CACHED flag. Implies HostVisible.
704 PreferBAR = 0x0004, // Will be allocated from a HOST_VISIBLE + DEVICE_LOCAL heap if available and possible (HOST_VISIBLE if not)
705
706 Dedicated = 0x0008, // Will not share a memory block with other resources
707 External = 0x0010, // To be used with VK_KHR_external_memory
708 Memoryless = 0x0020, // Will use LAZILY_ALLOCATED
709
710 NoError = 0x0040, // OOM is not fatal, return an invalid allocation
711 AutoBind = 0x0080, // Will automatically bind the allocation to the supplied VkBuffer/VkImage, avoids an extra lock to bind separately
712 };
713 ENUM_CLASS_FLAGS(EVulkanAllocationFlags);
714
715 // Manages heaps and their interactions
717 {
718 friend class FVulkanAllocation;
719 public:
720
723
724 void Init();
725 void Deinit();
726
728 {
729 return Device;
730 }
731
733 static float CalculateBufferPriority(const VkBufferUsageFlags BufferUsageFlags);
734
735 void FreeVulkanAllocation(FVulkanAllocation& Allocation, EVulkanFreeFlags FreeFlags = EVulkanFreeFlag_None);
740
741 // Legacy calls
742 bool AllocateBufferPooled(FVulkanAllocation& Allocation, FVulkanEvictable* AllocationOwner, uint32 Size, uint32 MinAlignment, VkBufferUsageFlags BufferUsageFlags, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, const char* File, uint32 Line);
743 bool AllocateImageMemory(FVulkanAllocation& Allocation, FVulkanEvictable* AllocationOwner, const VkMemoryRequirements& MemoryReqs, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, bool bExternal, const char* File, uint32 Line);
744 bool AllocateDedicatedImageMemory(FVulkanAllocation& Allocation, FVulkanEvictable* AllocationOwner, VkImage Image, const VkMemoryRequirements& MemoryReqs, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, bool bExternal, const char* File, uint32 Line);
745 private:
746 bool AllocateBufferMemory(FVulkanAllocation& Allocation, FVulkanEvictable* AllocationOwner, const VkMemoryRequirements& MemoryReqs, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, bool bExternal, bool bForceSeparateAllocation, const char* File, uint32 Line);
747
748 // New calls
749 public:
750 bool AllocateBufferMemory(FVulkanAllocation& OutAllocation, VkBuffer InBuffer, EVulkanAllocationFlags InAllocFlags, const TCHAR* InDebugName, uint32 InForceMinAlignment = 1);
751
755
756
757 void ReleaseFreedPages(const FVulkanContextArray& Contexts);
758 void DumpMemory(bool bFullDump = true);
759
760
763
764 void HandleOOM(bool bCanResume = false, VkResult Result = VK_SUCCESS, uint64 AllocationSize = 0, uint32 MemoryTypeIndex = 0);
765 bool UpdateEvictThreshold(bool bLog);
766
767 protected:
771
772 enum
773 {
774 BufferAllocationSize = 1 * 1024 * 1024,
776 };
777
778
779 // pool sizes that we support
780 enum class EPoolSizes : uint8
781 {
782// E32,
783// E64,
784 E128,
785 E256,
786 E512,
787 E1k,
788 E2k,
789 E8k,
790 E16k,
792 };
793
795 {
796// 32,
797// 64,
798 128,
799 256,
800 512,
801 1024,
802 2048,
803 8192,
804// 16 * 1024,
805 };
806
808 {
809// 64 * 1024,
810// 64 * 1024,
811 128 * 1024,
812 128 * 1024,
813 256 * 1024,
814 256 * 1024,
815 512 * 1024,
816 512 * 1024,
817 1024 * 1024,
818 1 * 1024 * 1024,
819 };
820
822 {
825 {
826 for (int32 i = 0; i < (int32)EPoolSizes::SizesCount; ++i)
827 {
828 if (PoolSizes[i] >= Size)
829 {
830 PoolSize = (EPoolSizes)i;
831 break;
832 }
833 }
834 }
835 return PoolSize;
836 }
837
841
842 FRWLock AllBufferAllocationsLock; // protects against resizing of array (RenderThread<->RHIThread)
850
852 bool bIsEvicting = false;
853 bool bWantEviction = false;
854
856
857 void ReleaseFreedResources(bool bImmediately);
864
865 struct
866 {
871
873 void ProcessPendingUBFrees(bool bForce);
874 };
875
877 {
878 public:
880
881 VkBuffer GetHandle() const;
882 void* GetMappedPointer();
883 uint32 GetSize() const;
885 void FlushMappedMemory();
887
888#if VULKAN_MEMORY_TRACK
890#endif
891
892 protected:
895
899
900 // Owner maintains lifetime
901 virtual ~FStagingBuffer();
902
903 void Destroy();
904
905 friend class FStagingManager;
906 };
907
952
953 // Simple temp allocation blocks used for volatile allocations
955 {
956 public:
968
970 {
973 };
974
976 virtual ~FTempBlockAllocator();
977
981
982 void UpdateBlocks();
983
984 protected:
987
989
993
998 };
999
1000
1001}
1002
1003#if VULKAN_CUSTOM_MEMORY_MANAGER_ENABLED
1005{
1006 static VKAPI_ATTR void* Alloc(void* UserData, size_t Size, size_t Alignment, VkSystemAllocationScope AllocScope);
1007 static VKAPI_ATTR void Free(void* pUserData, void* pMem);
1008 static VKAPI_ATTR void* Realloc(void* pUserData, void* pOriginal, size_t size, size_t alignment, VkSystemAllocationScope allocScope);
1011
1013
1014 enum
1015 {
1017 };
1018
1019 struct FType
1020 {
1021 size_t UsedMemory = 0;
1022 size_t MaxAllocSize = 0;
1024 };
1026
1028};
1029#endif
1030
1031#undef UE_API
#define VKAPI_ATTR
Definition AndroidPlatformMisc.cpp:2045
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define check(expr)
Definition AssertionMacros.h:314
#define checkNoEntry()
Definition AssertionMacros.h:316
FPlatformTypes::PTRINT PTRINT
A signed integer the same size as a pointer.
Definition Platform.h:1148
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
void Init()
Definition LockFreeList.h:4
EBufferUsageFlags
Definition RHIDefinitions.h:892
@ SLT_ReadOnly
Definition ScopeRWLock.h:138
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
FRWLock Lock
Definition UnversionedPropertySerialization.cpp:921
uint32 Offset
Definition VulkanMemory.cpp:4033
int32 GVulkanUseBufferBinning
Definition VulkanMemory.cpp:186
uint32 Size
Definition VulkanMemory.cpp:4034
int32 GVulkanUseBufferBinning
Definition VulkanMemory.cpp:186
EDelayAcquireImageType
Definition VulkanMemory.h:122
EDelayAcquireImageType GVulkanDelayAcquireImage
Definition VulkanDevice.cpp:93
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ScopeRWLock.h:199
Definition ScopeLock.h:141
Definition RefCounting.h:283
Definition VulkanCommandBuffer.h:43
Definition VulkanContext.h:241
Definition VulkanContext.h:55
Definition VulkanDevice.h:279
Definition VulkanMemory.h:104
virtual void Evict(FVulkanDevice &Device, const FVulkanContextArray &Contexts)
Definition VulkanMemory.h:108
virtual void Move(FVulkanDevice &Device, const FVulkanContextArray &Contexts, VulkanRHI::FVulkanAllocation &Allocation)
Definition VulkanMemory.h:109
virtual bool CanEvict() const
Definition VulkanMemory.h:107
virtual FVulkanTexture * GetEvictableTexture()
Definition VulkanMemory.h:110
virtual bool CanMove() const
Definition VulkanMemory.h:106
Definition VulkanQueue.h:53
Definition VulkanSubmission.h:54
Definition VulkanResources.h:604
Definition ArrayView.h:139
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition StaticArray.h:26
Definition CriticalSection.h:14
Definition VulkanMemory.h:176
uint32 bFreedBySystem
Definition VulkanMemory.h:243
void InvalidateMappedMemory(VkDeviceSize InOffset, VkDeviceSize InSize)
Definition VulkanMemory.cpp:1351
uint32 bDedicatedMemory
Definition VulkanMemory.h:244
VkDeviceSize Size
Definition VulkanMemory.h:235
uint32 bCanBeMapped
Definition VulkanMemory.h:240
bool CanBeMapped() const
Definition VulkanMemory.h:195
uint32 GetMemoryTypeIndex() const
Definition VulkanMemory.h:229
FDeviceMemoryAllocation()
Definition VulkanMemory.h:178
FVulkanTrackInfo Track
Definition VulkanMemory.h:249
VkDeviceMemory Handle
Definition VulkanMemory.h:237
VkDeviceSize GetSize() const
Definition VulkanMemory.h:224
VkDevice DeviceHandle
Definition VulkanMemory.h:236
void FlushMappedMemory(VkDeviceSize InOffset, VkDeviceSize InSize)
Definition VulkanMemory.cpp:1336
~FDeviceMemoryAllocation()
Definition VulkanMemory.cpp:1312
uint32 MemoryTypeIndex
Definition VulkanMemory.h:239
void * GetMappedPointer()
Definition VulkanMemory.h:205
void * MappedPointer
Definition VulkanMemory.h:238
uint32 bIsCoherent
Definition VulkanMemory.h:241
bool IsMapped() const
Definition VulkanMemory.h:200
bool IsCoherent() const
Definition VulkanMemory.h:211
uint32 bIsCached
Definition VulkanMemory.h:242
VkDeviceMemory GetHandle() const
Definition VulkanMemory.h:219
void Unmap()
Definition VulkanMemory.cpp:1329
Definition VulkanMemory.h:288
double MemoryUpdateTime
Definition VulkanMemory.h:343
void GetPrimaryHeapStatus(uint64 &OutAllocated, uint64 &OutLimit)
Definition VulkanMemory.cpp:767
void PrintMemInfo() const
Definition VulkanMemory.cpp:660
uint32 GetNumMemoryTypes() const
Definition VulkanMemory.h:311
bool bSupportsMemoryless
Definition VulkanMemory.h:351
const VkPhysicalDeviceMemoryProperties & GetMemoryProperties() const
Definition VulkanMemory.cpp:5037
FVulkanDevice * Device
Definition VulkanMemory.h:347
bool HasUnifiedMemory() const
Definition VulkanMemory.h:301
void Deinit()
Definition VulkanMemory.cpp:741
VkPhysicalDeviceMemoryBudgetPropertiesEXT MemoryBudget
Definition VulkanMemory.h:344
VkResult GetMemoryTypeFromProperties(uint32 TypeBits, VkMemoryPropertyFlags Properties, uint32 *OutTypeIndex)
Definition VulkanMemory.cpp:4994
int32 PrimaryHeapIndex
Definition VulkanMemory.h:368
void DumpMemory()
Definition VulkanMemory.cpp:1207
uint64 GetTotalMemory(bool bGPU) const
Definition VulkanMemory.cpp:1297
VkDeviceSize GetBaseHeapSize(uint32 HeapIndex) const
Definition VulkanMemory.cpp:1555
uint32 GetHeapIndex(uint32 MemoryTypeIndex)
Definition VulkanMemory.cpp:1591
FDeviceMemoryManager()
Definition VulkanMemory.cpp:539
FCriticalSection DeviceMemLock
Definition VulkanMemory.h:370
~FDeviceMemoryManager()
Definition VulkanMemory.cpp:553
bool SupportsMemoryType(VkMemoryPropertyFlags Properties) const
Definition VulkanMemory.cpp:755
FDeviceMemoryAllocation * Alloc(bool bCanFail, VkDeviceSize AllocationSize, uint32 MemoryTypeIndex, void *DedicatedAllocateInfo, float Priority, bool bExternal, const char *File, uint32 Line)
Definition VulkanMemory.cpp:793
TArray< FHeapInfo > HeapInfos
Definition VulkanMemory.h:366
VkPhysicalDeviceMemoryProperties MemoryProperties
Definition VulkanMemory.h:345
uint32 NumAllocations
Definition VulkanMemory.h:348
uint32 PeakNumAllocations
Definition VulkanMemory.h:349
VkResult GetMemoryTypeFromPropertiesExcluding(uint32 TypeBits, VkMemoryPropertyFlags Properties, uint32 ExcludeTypeIndex, uint32 *OutTypeIndex)
Definition VulkanMemory.cpp:5016
uint32 GetEvictedMemoryProperties()
Definition VulkanMemory.cpp:724
VkDevice DeviceHandle
Definition VulkanMemory.h:346
void TrimMemory(bool bFullTrim)
Definition VulkanMemory.cpp:1075
bool bHasUnifiedMemory
Definition VulkanMemory.h:350
void GetMemoryDump(TArray< FResourceHeapStats > &OutDeviceHeapsStats)
Definition VulkanMemory.cpp:1163
void FreeInternal(FDeviceMemoryAllocation *Allocation)
Definition VulkanMemory.cpp:1048
bool SupportsMemoryless() const
Definition VulkanMemory.h:306
Definition VulkanMemory.h:717
uint64 PendingEvictBytes
Definition VulkanMemory.h:851
void UnregisterSubresourceAllocator(FVulkanSubresourceAllocator *SubresourceAllocator)
Definition VulkanMemory.cpp:2859
FRWLock AllBufferAllocationsLock
Definition VulkanMemory.h:842
void FreeVulkanAllocationImage(FVulkanAllocation &Allocation)
Definition VulkanMemory.cpp:2389
struct VulkanRHI::FMemoryManager::@2445 UBAllocations
FCriticalSection UsedFreeBufferAllocationsLock
Definition VulkanMemory.h:838
void ProcessPendingUBFrees(bool bForce)
Definition VulkanMemory.cpp:3742
void ReleaseFreedPages(const FVulkanContextArray &Contexts)
Definition VulkanMemory.cpp:2270
bool bWantEviction
Definition VulkanMemory.h:853
@ BufferAllocationSize
Definition VulkanMemory.h:774
@ UniformBufferAllocationSize
Definition VulkanMemory.h:775
void DestroyResourceAllocations()
Definition VulkanMemory.cpp:2204
EPoolSizes
Definition VulkanMemory.h:781
bool ReleaseSubresourceAllocator(FVulkanSubresourceAllocator *SubresourceAllocator)
Definition VulkanMemory.cpp:2872
~FMemoryManager()
Definition VulkanMemory.cpp:2084
void DumpMemory(bool bFullDump=true)
Definition VulkanMemory.cpp:3153
void ProcessPendingUBFreesNoLock(bool bForce)
Definition VulkanMemory.cpp:3679
FVulkanSubresourceAllocator * GetSubresourceAllocator(const uint32 AllocatorIndex)
Definition VulkanMemory.h:845
void AllocUniformBuffer(FVulkanAllocation &OutAllocation, uint32 Size)
Definition VulkanMemory.cpp:3654
void FreeVulkanAllocationPooledBuffer(FVulkanAllocation &Allocation)
Definition VulkanMemory.cpp:2374
bool AllocateImageMemory(FVulkanAllocation &Allocation, FVulkanEvictable *AllocationOwner, const VkMemoryRequirements &MemoryReqs, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, bool bExternal, const char *File, uint32 Line)
Definition VulkanMemory.cpp:2918
PTRINT AllBufferAllocationsFreeListHead
Definition VulkanMemory.h:844
static float CalculateBufferPriority(const VkBufferUsageFlags BufferUsageFlags)
Definition VulkanMemory.cpp:2661
FCriticalSection CS
Definition VulkanMemory.h:867
void FreeVulkanAllocationBuffer(FVulkanAllocation &Allocation)
Definition VulkanMemory.cpp:2381
TArray< FUBPendingFree > PendingFree
Definition VulkanMemory.h:868
void FreeVulkanAllocation(FVulkanAllocation &Allocation, EVulkanFreeFlags FreeFlags=EVulkanFreeFlag_None)
Definition VulkanMemory.cpp:2470
FVulkanDevice & GetDevice()
Definition VulkanMemory.h:727
bool bIsEvicting
Definition VulkanMemory.h:852
void FreeVulkanAllocationImageDedicated(FVulkanAllocation &Allocation)
Definition VulkanMemory.cpp:2396
static constexpr uint32 BufferSizes[(int32) EPoolSizes::SizesCount+1]
Definition VulkanMemory.h:807
TArray< FVulkanSubresourceAllocator * > AllBufferAllocations
Definition VulkanMemory.h:843
FDeviceMemoryManager * DeviceMemoryManager
Definition VulkanMemory.h:769
static uint32 CalculateBufferAlignment(FVulkanDevice &InDevice, EBufferUsageFlags InUEUsage, bool bZeroSize)
Definition VulkanMemory.cpp:2647
void Init()
Definition VulkanMemory.cpp:2089
void Deinit()
Definition VulkanMemory.cpp:2188
FVulkanDevice & Device
Definition VulkanMemory.h:768
bool AllocateDedicatedImageMemory(FVulkanAllocation &Allocation, FVulkanEvictable *AllocationOwner, VkImage Image, const VkMemoryRequirements &MemoryReqs, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, bool bExternal, const char *File, uint32 Line)
Definition VulkanMemory.cpp:3097
TArray< FVulkanSubresourceAllocator * > UsedBufferAllocations[(int32) EPoolSizes::SizesCount+1]
Definition VulkanMemory.h:839
TArray< FVulkanResourceHeap * > ResourceTypeHeaps
Definition VulkanMemory.h:770
void ReleaseFreedResources(bool bImmediately)
Definition VulkanMemory.cpp:2238
void RegisterSubresourceAllocator(FVulkanSubresourceAllocator *SubresourceAllocator)
Definition VulkanMemory.cpp:2840
bool AllocateBufferPooled(FVulkanAllocation &Allocation, FVulkanEvictable *AllocationOwner, uint32 Size, uint32 MinAlignment, VkBufferUsageFlags BufferUsageFlags, VkMemoryPropertyFlags MemoryPropertyFlags, EVulkanAllocationMetaType MetaType, const char *File, uint32 Line)
Definition VulkanMemory.cpp:2733
TArray< FVulkanSubresourceAllocator * > FreeBufferAllocations[(int32) EPoolSizes::SizesCount+1]
Definition VulkanMemory.h:840
static constexpr uint32 PoolSizes[(int32) EPoolSizes::SizesCount]
Definition VulkanMemory.h:794
void HandleOOM(bool bCanResume=false, VkResult Result=VK_SUCCESS, uint64 AllocationSize=0, uint32 MemoryTypeIndex=0)
Definition VulkanMemory.cpp:3635
EPoolSizes GetPoolTypeForAlloc(uint32 Size, uint32 Alignment)
Definition VulkanMemory.h:821
bool UpdateEvictThreshold(bool bLog)
Definition VulkanMemory.cpp:2897
void FreeUniformBuffer(FVulkanAllocation &InAllocation)
Definition VulkanMemory.cpp:3664
uint32 Peak
Definition VulkanMemory.h:869
Definition VulkanMemory.h:877
VkBuffer Buffer
Definition VulkanMemory.h:896
uint32 BufferSize
Definition VulkanMemory.h:898
void FlushMappedMemory()
Definition VulkanMemory.cpp:4285
VkMemoryPropertyFlagBits MemoryReadFlags
Definition VulkanMemory.h:897
FVulkanTrackInfo Track
Definition VulkanMemory.h:889
void InvalidateMappedMemory()
Definition VulkanMemory.cpp:4290
VkBuffer GetHandle() const
Definition VulkanMemory.cpp:4259
uint32 GetSize() const
Definition VulkanMemory.cpp:4275
FVulkanAllocation Allocation
Definition VulkanMemory.h:894
FVulkanDevice * Device
Definition VulkanMemory.h:893
void * GetMappedPointer()
Definition VulkanMemory.cpp:4270
VkDeviceMemory GetDeviceMemoryHandle() const
Definition VulkanMemory.cpp:4280
virtual ~FStagingBuffer()
Definition VulkanMemory.cpp:4264
void Destroy()
Definition VulkanMemory.cpp:4296
Definition VulkanMemory.h:909
void Deinit()
Definition VulkanMemory.cpp:4312
TArray< FFreeEntry > FreeStagingBuffers
Definition VulkanMemory.h:943
uint64 PeakUsedMemory
Definition VulkanMemory.h:945
void ProcessPendingFree(bool bImmediately, bool bFreeToOS)
Definition VulkanMemory.cpp:4517
TArray< FStagingBuffer * > UsedStagingBuffers
Definition VulkanMemory.h:936
void ReleaseBuffer(FVulkanContextCommon *Context, FStagingBuffer *&StagingBuffer)
Definition VulkanMemory.cpp:4396
void GetMemoryDump(FResourceHeapStats &Stats)
Definition VulkanMemory.cpp:4417
TMap< FVulkanSyncPointRef, TArray< FStagingBuffer * > > PendingFreeStagingBuffers
Definition VulkanMemory.h:937
FStagingBuffer * AcquireBuffer(uint32 Size, VkBufferUsageFlags InUsageFlags=VK_BUFFER_USAGE_TRANSFER_SRC_BIT, VkMemoryPropertyFlagBits InMemoryReadFlags=VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
Definition VulkanMemory.cpp:4324
void ProcessPendingFreeNoLock(bool bImmediately, bool bFreeToOS)
Definition VulkanMemory.cpp:4479
uint64 UsedMemory
Definition VulkanMemory.h:946
~FStagingManager()
Definition VulkanMemory.cpp:4308
FCriticalSection StagingLock
Definition VulkanMemory.h:934
FStagingManager()
Definition VulkanMemory.cpp:4304
void DumpMemory()
Definition VulkanMemory.cpp:4448
void Init(FVulkanDevice *InDevice)
Definition VulkanMemory.h:914
FVulkanDevice * Device
Definition VulkanMemory.h:950
Definition VulkanMemory.h:955
uint8 * Alloc(uint32 InSize, FVulkanContextCommon &Context, VkDescriptorBufferBindingInfoEXT &OutBindingInfo, VkDeviceSize &OutOffset)
Definition VulkanMemory.cpp:4828
FVulkanDevice & Device
Definition VulkanMemory.h:988
FInternalAlloc InternalAlloc(uint32 InSize, FVulkanContextCommon &Context)
Definition VulkanMemory.cpp:4777
virtual ~FTempBlockAllocator()
Definition VulkanMemory.cpp:4715
TArray< FTempMemoryBlock * > AvailableBlocks
Definition VulkanMemory.h:996
const VkBufferUsageFlags BufferUsage
Definition VulkanMemory.h:992
const uint32 BlockSize
Definition VulkanMemory.h:990
TArray< FTempMemoryBlock * > BusyBlocks
Definition VulkanMemory.h:995
FTempMemoryBlock * CurrentBlock
Definition VulkanMemory.h:994
FTempMemoryBlock * AllocBlock()
Definition VulkanMemory.cpp:4740
void UpdateBlocks()
Definition VulkanMemory.cpp:4874
FRWLock RWLock
Definition VulkanMemory.h:997
const uint32 BlockAlignment
Definition VulkanMemory.h:991
Definition VulkanMemory.h:418
void * GetMappedPointer(FVulkanDevice *Device)
Definition VulkanMemory.cpp:3846
uint32 AllocationIndex
Definition VulkanMemory.h:436
VkBuffer GetBufferHandle() const
Definition VulkanMemory.cpp:3866
void SetType(EVulkanAllocationType InType)
Definition VulkanMemory.h:448
FVulkanAllocation()
Definition VulkanMemory.cpp:3767
bool IsValid() const
Definition VulkanMemory.cpp:3842
uint32 Size
Definition VulkanMemory.h:434
uint32 Offset
Definition VulkanMemory.h:435
void Reference(const FVulkanAllocation &Other)
Definition VulkanMemory.cpp:3822
uint8 bHasOwnership
Definition VulkanMemory.h:440
uint64 VulkanHandle
Definition VulkanMemory.h:432
uint8 Type
Definition VulkanMemory.h:439
void Disown()
Definition VulkanMemory.cpp:3832
uint16 AllocatorIndex
Definition VulkanMemory.h:437
uint8 bTransient
Definition VulkanMemory.h:441
FVulkanSubresourceAllocator * GetSubresourceAllocator(FVulkanDevice *Device) const
Definition VulkanMemory.cpp:3901
~FVulkanAllocation()
Definition VulkanMemory.cpp:3772
EVulkanAllocationMetaType MetaType
Definition VulkanMemory.h:438
uint32 GetBufferAlignment(FVulkanDevice *Device) const
Definition VulkanMemory.cpp:3870
void InvalidateMappedMemory(FVulkanDevice *Device)
Definition VulkanMemory.cpp:3860
VkDeviceMemory GetDeviceMemoryHandle(FVulkanDevice *Device) const
Definition VulkanMemory.cpp:3875
EVulkanAllocationType GetType() const
Definition VulkanMemory.h:444
void BindImage(FVulkanDevice *Device, VkImage Image)
Definition VulkanMemory.cpp:3891
void Own()
Definition VulkanMemory.cpp:3837
void FlushMappedMemory(FVulkanDevice *Device)
Definition VulkanMemory.cpp:3854
uint32 HandleId
Definition VulkanMemory.h:433
void BindBuffer(FVulkanDevice *Device, VkBuffer Buffer)
Definition VulkanMemory.cpp:3881
bool HasAllocation() const
Definition VulkanMemory.cpp:3827
Definition VulkanMemory.h:620
uint32 GetMemoryTypeIndex() const
Definition VulkanMemory.h:645
uint8 DefragCountDown
Definition VulkanMemory.h:670
@ MAX_BUCKETS
Definition VulkanMemory.h:660
uint32 PageIDCounter
Definition VulkanMemory.h:676
bool IsHostCachedSupported() const
Definition VulkanMemory.h:635
uint16 MemoryTypeIndex
Definition VulkanMemory.h:665
bool bIsLazilyAllocatedSupported
Definition VulkanMemory.h:669
bool AllocateResource(FVulkanAllocation &OutAllocation, FVulkanEvictable *AllocationOwner, EType Type, uint32 Size, uint32 Alignment, bool bMapAllocation, bool bForceSeparateAllocation, EVulkanAllocationMetaType MetaType, bool bExternal, const char *File, uint32 Line)
Definition VulkanMemory.cpp:1943
TArray< FVulkanSubresourceAllocator * > ActivePages[MAX_BUCKETS]
Definition VulkanMemory.h:679
void SetDefragging(FVulkanSubresourceAllocator *Allocator)
Definition VulkanMemory.cpp:1704
uint32 PeakPageSize
Definition VulkanMemory.h:674
FCriticalSection PagesLock
Definition VulkanMemory.h:678
bool bIsHostCachedSupported
Definition VulkanMemory.h:668
uint64 EvictOne(FVulkanDevice &Device, const FVulkanContextArray &Contexts)
Definition VulkanMemory.cpp:1686
void ReleasePage(FVulkanSubresourceAllocator *InPage)
Definition VulkanMemory.cpp:1638
const uint16 HeapIndex
Definition VulkanMemory.h:666
~FVulkanResourceHeap()
Definition VulkanMemory.cpp:1612
bool AllocateDedicatedImage(FVulkanAllocation &OutAllocation, FVulkanEvictable *AllocationOwner, VkImage Image, uint32 Size, uint32 Alignment, EVulkanAllocationMetaType MetaType, bool bExternal, const char *File, uint32 Line)
Definition VulkanMemory.cpp:2037
FMemoryManager * Owner
Definition VulkanMemory.h:664
uint32 OverridePageSize
Definition VulkanMemory.h:672
void DumpMemory(FResourceHeapStats &Stats)
Definition VulkanMemory.cpp:1856
TArray< FVulkanSubresourceAllocator * > UsedDedicatedImagePages
Definition VulkanMemory.h:680
bool GetIsDefragging(FVulkanSubresourceAllocator *Allocator)
Definition VulkanMemory.cpp:1738
void DefragTick(FVulkanDevice &Device, const FVulkanContextArray &Contexts, uint32 Count)
Definition VulkanMemory.cpp:1743
bool TryRealloc(FVulkanAllocation &OutAllocation, FVulkanEvictable *AllocationOwner, EType Type, uint32 Size, uint32 Alignment, EVulkanAllocationMetaType MetaType)
Definition VulkanMemory.cpp:1907
TArray< FVulkanPageSizeBucket, TFixedAllocator< MAX_BUCKETS > > PageSizeBuckets
Definition VulkanMemory.h:662
uint64 UsedMemory
Definition VulkanMemory.h:675
uint32 GetPageSizeBucket(FVulkanPageSizeBucket &BucketOut, EType Type, uint32 AllocationSize, bool bForceSingleAllocation)
Definition VulkanMemory.cpp:1568
void FreePage(FVulkanSubresourceAllocator *InPage)
Definition VulkanMemory.cpp:1648
bool IsLazilyAllocatedSupported() const
Definition VulkanMemory.h:640
FMemoryManager * GetOwner()
Definition VulkanMemory.h:630
Definition VulkanMemory.h:505
VkBufferUsageFlags BufferUsageFlags
Definition VulkanMemory.h:584
uint32 MaxSize
Definition VulkanMemory.h:579
FMemoryManager * Owner
Definition VulkanMemory.h:575
void SetFreePending(FVulkanAllocation &Allocation)
Definition VulkanMemory.cpp:2404
uint32 GetHandleId() const
Definition VulkanMemory.h:538
VkMemoryPropertyFlags MemoryPropertyFlags
Definition VulkanMemory.h:577
uint8 GetSubresourceAllocatorFlags()
Definition VulkanMemory.h:551
TArray< FRange > FreeList
Definition VulkanMemory.h:600
uint32 FrameFreed
Definition VulkanMemory.h:581
uint32 GetId()
Definition VulkanMemory.h:555
TArrayView< uint32 > GetMemoryUsed()
Definition VulkanMemory.cpp:4017
uint32 BufferId
Definition VulkanMemory.h:586
void DumpFullHeap()
Definition VulkanMemory.cpp:4040
void SetIsDefragging(bool bInIsDefragging)
Definition VulkanMemory.h:563
uint32 AllocatorIndex
Definition VulkanMemory.h:588
bool bIsDefragging
Definition VulkanMemory.h:593
EVulkanAllocationType GetType()
Definition VulkanMemory.h:546
int32 AllocateInternalData()
Definition VulkanMemory.cpp:3929
VkBuffer Buffer
Definition VulkanMemory.h:585
uint8 BucketId
Definition VulkanMemory.h:590
int32 DefragTick(FVulkanDevice &Device, const FVulkanContextArray &Contexts, FVulkanResourceHeap *Heap, uint32 Count)
Definition VulkanMemory.cpp:4133
bool bLocked
Definition VulkanMemory.h:592
uint32 MemoryUsed[EVulkanAllocationMetaSize]
Definition VulkanMemory.h:572
uint32 MemoryTypeIndex
Definition VulkanMemory.h:576
EVulkanAllocationType Type
Definition VulkanMemory.h:574
uint32 GetNumSubAllocations()
Definition VulkanMemory.cpp:4022
FCriticalSection SubresourceAllocatorCS
Definition VulkanMemory.h:613
FDeviceMemoryAllocation * GetMemoryAllocation()
Definition VulkanMemory.h:542
bool CanDefrag()
Definition VulkanMemory.cpp:4114
uint32 FreeCalls
Definition VulkanMemory.h:597
uint32 GetMaxSize() const
Definition VulkanMemory.h:535
int32 InternalFreeList
Definition VulkanMemory.h:612
void FreeInternalData(int32 Index)
Definition VulkanMemory.cpp:3918
uint32 GetUsedSize() const
Definition VulkanMemory.h:536
uint32 LastDefragFrame
Definition VulkanMemory.h:582
uint32 GetAllocatorIndex()
Definition VulkanMemory.h:602
uint32 AllocCalls
Definition VulkanMemory.h:596
bool JoinFreeBlocks()
Definition VulkanMemory.cpp:3748
int64 UsedSize
Definition VulkanMemory.h:583
TArray< FVulkanAllocationInternal > InternalData
Definition VulkanMemory.h:611
void * GetMappedPointer()
Definition VulkanMemory.h:528
uint8 SubresourceAllocatorFlags
Definition VulkanMemory.h:589
bool TryAllocate2(FVulkanAllocation &OutAllocation, FVulkanEvictable *Owner, uint32 InSize, uint32 InAlignment, EVulkanAllocationMetaType InMetaType, const char *File, uint32 Line)
Definition VulkanMemory.cpp:3949
uint32 NumSubAllocations
Definition VulkanMemory.h:595
bool GetIsDefragging()
Definition VulkanMemory.h:559
FDeviceMemoryAllocation * MemoryAllocation
Definition VulkanMemory.h:578
bool bIsEvicting
Definition VulkanMemory.h:591
uint32 GetAlignment() const
Definition VulkanMemory.h:523
uint32 Alignment
Definition VulkanMemory.h:580
int32 PoolSizeIndex
Definition VulkanMemory.h:587
FVulkanTrackInfo Track
Definition VulkanMemory.h:609
uint64 EvictToHost(FVulkanDevice &Device, const FVulkanContextArray &Contexts)
Definition VulkanMemory.cpp:4222
~FVulkanSubresourceAllocator()
Definition VulkanMemory.cpp:2591
EVulkanAllocationFlags
Definition VulkanMemory.h:699
EType
Definition VulkanMemory.h:168
EVulkanFreeFlags
Definition VulkanMemory.h:691
@ EVulkanFreeFlag_None
Definition VulkanMemory.h:692
@ EVulkanFreeFlag_DontDefer
Definition VulkanMemory.h:693
EVulkanAllocationMetaType
Definition VulkanMemory.h:148
@ EVulkanAllocationMetaUnknown
Definition VulkanMemory.h:149
@ EVulkanAllocationMetaMultiBuffer
Definition VulkanMemory.h:151
@ EVulkanAllocationMetaImageRenderTarget
Definition VulkanMemory.h:154
@ EVulkanAllocationMetaImageOther
Definition VulkanMemory.h:155
@ EVulkanAllocationMetaFrameTempBuffer
Definition VulkanMemory.h:153
@ EVulkanAllocationMetaBufferUAV
Definition VulkanMemory.h:156
@ EVulkanAllocationMetaBufferStaging
Definition VulkanMemory.h:157
@ EVulkanAllocationMetaSize
Definition VulkanMemory.h:159
@ EVulkanAllocationMetaRingBuffer
Definition VulkanMemory.h:152
@ EVulkanAllocationMetaBufferOther
Definition VulkanMemory.h:158
@ EVulkanAllocationMetaUniformBuffer
Definition VulkanMemory.h:150
EVulkanAllocationType
Definition VulkanMemory.h:138
@ EVulkanAllocationBuffer
Definition VulkanMemory.h:141
@ EVulkanAllocationPooledBuffer
Definition VulkanMemory.h:140
@ EVulkanAllocationEmpty
Definition VulkanMemory.h:139
@ EVulkanAllocationSize
Definition VulkanMemory.h:144
@ EVulkanAllocationImage
Definition VulkanMemory.h:142
@ EVulkanAllocationImageDedicated
Definition VulkanMemory.h:143
ELegacyVulkanAllocationFlags
Definition VulkanMemory.h:162
@ VulkanAllocationFlagsCanEvict
Definition VulkanMemory.h:164
@ VulkanAllocationFlagsMapped
Definition VulkanMemory.h:163
@ NUM_FRAMES_TO_WAIT_BEFORE_RELEASING_TO_OS
Definition VulkanMemory.h:135
ECollisionShapeType GetType(const Chaos::FImplicitObject &InGeometry)
Definition ChaosInterfaceWrapperCore.h:105
Definition VulkanCommandBuffer.h:22
FORCEINLINE uint32 GetTypeHash(const FDeviceMemoryBlockKey &BlockKey)
Definition VulkanMemory.h:267
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
static uint32 TypeCrc32(const T &Data, uint32 CRC=0)
Definition Crc.h:38
Definition VulkanContext.h:517
Definition VulkanMemory.h:115
void * Data
Definition VulkanMemory.h:117
int32 SizeOrLine
Definition VulkanMemory.h:118
FVulkanTrackInfo()
Definition VulkanMemory.cpp:301
Definition VulkanMemory.h:257
bool operator==(const FDeviceMemoryBlockKey &Other) const
Definition VulkanMemory.h:261
uint32 MemoryTypeIndex
Definition VulkanMemory.h:258
VkDeviceSize BlockSize
Definition VulkanMemory.h:259
Definition VulkanMemory.h:276
uint32 FrameFreed
Definition VulkanMemory.h:278
FDeviceMemoryAllocation * Allocation
Definition VulkanMemory.h:277
Definition VulkanMemory.h:273
TArray< FFreeBlock > Allocations
Definition VulkanMemory.h:280
FDeviceMemoryBlockKey Key
Definition VulkanMemory.h:274
Definition VulkanMemory.h:354
VkDeviceSize PeakSize
Definition VulkanMemory.h:356
VkDeviceSize UsedSize
Definition VulkanMemory.h:355
FHeapInfo()
Definition VulkanMemory.h:359
TArray< FDeviceMemoryAllocation * > Allocations
Definition VulkanMemory.h:357
Definition VulkanMemory.h:860
int64 Frame
Definition VulkanMemory.h:862
FVulkanAllocation Allocation
Definition VulkanMemory.h:861
Definition VulkanMemory.h:374
static void SanityCheck(TArray< FRange > &Ranges)
Definition VulkanMemory.cpp:1507
uint32 Offset
Definition VulkanMemory.h:375
bool operator<(const FRange &In) const
Definition VulkanMemory.h:378
static void AllocateFromEntry(TArray< FRange > &Ranges, int32 Index, uint32 SizeToAllocate)
Definition VulkanMemory.cpp:1488
static int32 AppendAndTryToMerge(TArray< FRange > &Ranges, const FRange &Item)
Definition VulkanMemory.cpp:1463
static void JoinConsecutiveRanges(TArray< FRange > &Ranges)
Definition VulkanMemory.cpp:1366
uint32 Size
Definition VulkanMemory.h:376
static int32 InsertAndTryToMerge(TArray< FRange > &Ranges, const FRange &Item, int32 ProposedIndex)
Definition VulkanMemory.cpp:1393
Definition VulkanMemory.cpp:386
Definition VulkanMemory.h:939
uint32 FrameNumber
Definition VulkanMemory.h:941
FStagingBuffer * StagingBuffer
Definition VulkanMemory.h:940
uint32 Offset
Definition VulkanMemory.h:972
FTempMemoryBlock * Block
Definition VulkanMemory.h:971
TArray< FVulkanSyncPointRef > SyncPoints
Definition VulkanMemory.h:965
FVulkanAllocation Allocation
Definition VulkanMemory.h:959
VkBuffer Buffer
Definition VulkanMemory.h:960
uint8 * MappedPointer
Definition VulkanMemory.h:961
VkDeviceAddress BufferAddress
Definition VulkanMemory.h:962
std::atomic< uint32 > CurrentOffset
Definition VulkanMemory.h:966
Definition VulkanMemory.h:468
EVulkanAllocationType Type
Definition VulkanMemory.h:481
int32 NextFree
Definition VulkanMemory.h:490
FVulkanTrackInfo Track
Definition VulkanMemory.h:493
uint32 Size
Definition VulkanMemory.h:484
uint32 AllocationOffset
Definition VulkanMemory.h:486
int State
Definition VulkanMemory.h:478
uint32 Alignment
Definition VulkanMemory.h:488
EVulkanAllocationMetaType MetaType
Definition VulkanMemory.h:482
uint32 AllocationSize
Definition VulkanMemory.h:485
@ EFREEDISCARDED
Definition VulkanMemory.h:475
@ EUNUSED
Definition VulkanMemory.h:471
@ EALLOCATED
Definition VulkanMemory.h:472
@ EFREEPENDING
Definition VulkanMemory.h:474
@ EFREED
Definition VulkanMemory.h:473
FVulkanEvictable * AllocationOwner
Definition VulkanMemory.h:487
Definition VulkanMemory.h:402
uint32 BucketMask
Definition VulkanMemory.h:410
uint64 AllocationMax
Definition VulkanMemory.h:403
@ BUCKET_MASK_BUFFER
Definition VulkanMemory.h:408
@ BUCKET_MASK_IMAGE
Definition VulkanMemory.h:407
uint32 PageSize
Definition VulkanMemory.h:404