UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RHICoreTransientResourceAllocator.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5#include "Algo/Partition.h"
6
7#define RHICORE_TRANSIENT_ALLOCATOR_DEBUG (!UE_BUILD_SHIPPING && !UE_BUILD_TEST)
8
9#if RHICORE_TRANSIENT_ALLOCATOR_DEBUG
10 #define IF_RHICORE_TRANSIENT_ALLOCATOR_DEBUG(Op) Op
11#else
12 #define IF_RHICORE_TRANSIENT_ALLOCATOR_DEBUG(Op)
13#endif
14
16{
17 // Make sure all padding is removed.
21 return CityHash64WithSeed((const char*)&NewInfo, sizeof(FRHITextureCreateInfo), HeapOffset);
22}
23
25{
26 // Make sure all padding is removed.
30 return CityHash64((const char*)&NewInfo, sizeof(FRHITextureCreateInfo));
31}
32
34{
35 // Make sure all padding is removed.
39 return CityHash64WithSeed(reinterpret_cast<const char*>(&NewInfo), sizeof(NewInfo), HeapOffset);
40}
41
43{
44 // Make sure all padding is removed.
48 return CityHash64(reinterpret_cast<const char*>(&NewInfo), sizeof(NewInfo));
49}
50
53{
55
57 {
58 AllocatedSize += Other.AllocatedSize;
59 AllocationCount += Other.AllocationCount;
60 DeallocationCount += Other.DeallocationCount;
61 CreateCount += Other.CreateCount;
62 }
63
65 {
68 }
69
71 {
73 }
74
75 // The number of bytes allocated from the transient allocator this cycle.
77
78 // The number of allocations made from the transient allocator this cycle.
80
81 // the number of deallocations made from the transient allocator this cycle.
83
84 // The number of resource creations made from the transient allocator this cycle.
86};
87
90{
91public:
93
95 {
96 Textures.Add(Other.Textures);
97 Buffers.Add(Other.Buffers);
98 AliasedSize = FMath::Max(AliasedSize, Other.AliasedSize);
99 }
100
107
113
120
126
127 void Reset()
128 {
129 Textures = {};
130 Buffers = {};
132 }
133
134 RHICORE_API void Submit(uint64 TotalMemoryCapacity);
135
137
140
141 // Total allocated memory usage with aliasing.
143
144 // Current aliased size as items are being allocated / deallocated.
146};
147
153template <typename TransientResourceType>
155{
156public:
157 static const uint32 kInfinity = ~0u;
160
164 : GarbageCollectLatency(InGarbageCollectLatency)
165 , Capacity(InCapacity)
166 {
167 if (Capacity != kInfinity)
168 {
169 Cache.Reserve(Capacity);
170 }
171 }
172
174 {
175 for (const FCacheItem& Item : Cache)
176 {
177 delete Item.Resource;
178 }
179
180 for (TransientResourceType* Resource : Allocated)
181 {
182 delete Resource;
183 }
184 }
185
186 template <typename CreateFunctionType>
188 {
189 for (int32 Index = 0; Index < Cache.Num(); ++Index)
190 {
191 const FCacheItem& CacheItem = Cache[Index];
192
193 if (CacheItem.Hash == Hash)
194 {
195 TransientResourceType* Resource = CacheItem.Resource;
197 Allocated.Emplace(Resource);
198 HitCount++;
199 return Resource;
200 }
201 }
202
203 TRACE_CPUPROFILER_EVENT_SCOPE(CreatePlacedResource);
204 TransientResourceType* Resource = CreateFunction(Hash);
205 Allocated.Emplace(Resource);
206 MissCount++;
207 return Resource;
208 }
209
210 template <typename ReleaseFunctionType>
212 {
213 const int32 FirstForfeitIndex = Algo::Partition(Allocated.GetData(), Allocated.Num(), [](const FRHITransientResource* Resource) { return Resource->IsAcquired(); });
214 const auto ResourcesToForfeit = MakeArrayView(Allocated.GetData() + FirstForfeitIndex, Allocated.Num() - FirstForfeitIndex);
215
217 {
218 Cache.Emplace(Resource, Resource->GetHash(), CurrentFrameIndex);
219 }
220
222
223 Algo::Sort(Cache, [](const FCacheItem& LHS, const FCacheItem& RHS)
224 {
225 return LHS.LastUsedFrame > RHS.LastUsedFrame;
226 });
227
228 while (uint32(Cache.Num()) > Capacity)
229 {
230 if (!TryReleaseItem(CurrentFrameIndex, ReleaseFunction))
231 {
232 break;
233 }
234 }
235
236 HitCount = 0;
237 MissCount = 0;
238 }
239
240 void Forfeit(uint64 CurrentFrameIndex)
241 {
242 Forfeit(CurrentFrameIndex, [](TransientResourceType*) {});
243 }
244
246
247 uint32 GetAllocatedCount() const { return Allocated.Num(); }
248
249 uint32 GetSize() const { return Cache.Num(); }
250
251 uint32 GetCapacity() const { return Capacity; }
252
253 uint32 GetHitCount() const { return HitCount; }
254
255 uint32 GetMissCount() const { return MissCount; }
256
257 float GetHitPercentage() const { return (float)HitCount / (float)(HitCount + MissCount); }
258
259private:
260 template <typename ReleaseFunctionType>
261 bool TryReleaseItem(uint64 CurrentFrameIndex, ReleaseFunctionType ReleaseFunction)
262 {
263 const FCacheItem& Item = Cache.Top();
264
265 if (Item.LastUsedFrame + GarbageCollectLatency <= CurrentFrameIndex)
266 {
267 ReleaseFunction(Item.Resource);
268 delete Item.Resource;
269 Cache.Pop();
270 return true;
271 }
272
273 return false;
274 }
275
276 struct FCacheItem
277 {
279 : Resource(InResource)
280 , Hash(InHash)
281 , LastUsedFrame(InLastUsedFrame)
282 {}
283
284 TransientResourceType* Resource;
285 uint64 Hash{};
286 uint64 LastUsedFrame{};
287 };
288
289 TArray<FCacheItem> Cache;
291 uint32 GarbageCollectLatency;
292 uint32 Capacity;
293 uint32 HitCount = 0;
294 uint32 MissCount = 0;
295};
296
298
301{
302public:
303 virtual ~IRHITransientMemoryCache() = default;
304
305 virtual void GarbageCollect() = 0;
306};
307
311
314
317{
318public:
330
332
334
336
337 RHICORE_API void Flush();
338
340 {
341 GpuVirtualAddress = InGpuVirtualAddress;
342 }
343
344 uint64 GetGpuVirtualAddress() const { return GpuVirtualAddress; }
345 uint64 GetCapacity() const { return Capacity; }
346 uint64 GetUsedSize() const { return UsedSize; }
347 uint64 GetFreeSize() const { return Capacity - UsedSize; }
348 uint64 GetAlignmentWaste() const { return AlignmentWaste; }
349 uint32 GetAllocationCount() const { return AllocationCount; }
350
351 bool IsFull() const { return UsedSize == Capacity; }
352 bool IsEmpty() const { return UsedSize == 0; }
353
354private:
355 using FRangeHandle = uint16;
356 static const FRangeHandle InvalidRangeHandle = FRangeHandle(~0);
357
358 struct FRange
359 {
360 FRHITransientResource* Resource = nullptr;
362 uint64 Size = 0;
363 uint64 Offset = 0;
364 FRangeHandle NextFreeHandle = InvalidRangeHandle;
365 FRangeHandle PrevFreeHandle = InvalidRangeHandle;
366
367 inline uint64 GetStart() const { return Offset; }
368 inline uint64 GetEnd() const { return Size + Offset; }
369 };
370
371 inline FRangeHandle GetFirstFreeRangeHandle()
372 {
373 return Ranges[HeadHandle].NextFreeHandle;
374 }
375
376 FRangeHandle CreateRange()
377 {
378 if (!RangeFreeList.IsEmpty())
379 {
380 return RangeFreeList.Pop();
381 }
382 Ranges.Emplace();
383 return FRangeHandle(Ranges.Num() - 1);
384 }
385
386 FRangeHandle InsertRange(FRangeHandle PreviousHandle, FRHITransientResource* Resource, const FRHITransientAllocationFences& Fences, uint64 Offset, uint64 Size)
387 {
388 FRangeHandle Handle = CreateRange();
389
390 FRange& CurrentRange = Ranges[Handle];
391 CurrentRange.Resource = Resource;
392 CurrentRange.Fences = Fences;
393 CurrentRange.Offset = Offset;
394 CurrentRange.Size = Size;
395
396 FRange& PreviousRange = Ranges[PreviousHandle];
397 CurrentRange.NextFreeHandle = PreviousRange.NextFreeHandle;
398 PreviousRange.NextFreeHandle = Handle;
399
400 return Handle;
401 }
402
403 FRangeHandle RemoveRange(FRangeHandle PreviousHandle, FRangeHandle CurrentHandle)
404 {
405 FRange& PreviousRange = Ranges[PreviousHandle];
406 FRange& CurrentRange = Ranges[CurrentHandle];
407
408 FRangeHandle NextCurrentHandle = CurrentRange.NextFreeHandle;
409
410 check(PreviousRange.NextFreeHandle == CurrentHandle);
411 PreviousRange.NextFreeHandle = CurrentRange.NextFreeHandle;
412 CurrentRange.NextFreeHandle = InvalidRangeHandle;
413 CurrentRange.Resource = nullptr;
414
415 RangeFreeList.Add(CurrentHandle);
416 return NextCurrentHandle;
417 }
418
419 struct FFindResult
420 {
421 uint64 LeftoverSize = 0;
422 FRangeHandle PreviousHandle = InvalidRangeHandle;
423 FRangeHandle FoundHandle = InvalidRangeHandle;
424 };
425
426 RHICORE_API void Validate();
427
428 uint64 GpuVirtualAddress = 0;
429 uint64 Capacity = 0;
430 uint64 UsedSize = 0;
431 uint64 AlignmentWaste = 0;
432 uint32 AllocationCount = 0;
433 uint32 AlignmentMin = 0;
434
435 FRangeHandle HeadHandle = InvalidRangeHandle;
436 TArray<FRangeHandle> RangeFreeList;
437 TArray<FRange> Ranges;
438};
439
441
443{
444 // Supports placing buffers onto the heap.
445 AllowBuffers = 1 << 0,
446
447 // Supports placing textures with UAV support onto the heap.
448 AllowTextures = 1 << 1,
449
450 // Supports placing render targets onto the heap.
451 AllowRenderTargets = 1 << 2,
452
453 // Supports placing NNE accessible buffers onto the heap. Differentiation is required for DirectML with multi-GPU.
454 AllowNNEBuffers = 1 << 3,
455
456 // Supports all resource types.
458};
459
461
467{
468public:
470 {
471 // Size of the heap in bytes.
473
474 // Alignment of the heap in bytes.
476
477 // Flags used to filter resource allocations within the heap.
479
480 // Size of the texture cache before elements are evicted.
482
483 // Size of the buffer cache before elements are evicted.
485 };
486
488 {
494
495 // The heap on which to create the resource.
497
498 // The allocation (offset / size) on the provided heap.
500
501 // The unique hash computed from the create info and allocation offset.
503 };
504
507
509 : Initializer(InInitializer)
510 , Allocator(InInitializer.Size, InInitializer.Alignment)
511 , AlignmentLog2(FPlatformMath::CeilLogTwo64(InInitializer.Alignment))
512 , Textures(InInitializer.TextureCacheSize)
513 , Buffers(InInitializer.BufferCacheSize)
514 {
515 check(1ull << AlignmentLog2 == InInitializer.Alignment);
516 }
517
518 virtual ~FRHITransientHeap() = default;
519
521 const FRHITextureCreateInfo& CreateInfo,
522 const TCHAR* DebugName,
523 const FRHITransientAllocationFences& Fences,
525 uint64 TextureSize,
528
530
532 const FRHIBufferCreateInfo& CreateInfo,
533 const TCHAR* DebugName,
534 const FRHITransientAllocationFences& Fences,
536 uint64 BufferSize,
537 uint32 BufferAlignment,
539
541
543
544 const FInitializer& GetInitializer() const { return Initializer; }
545
546 uint64 GetCapacity() const { return Allocator.GetCapacity(); }
547
548 uint64 GetGPUVirtualAddress() const { return Allocator.GetGpuVirtualAddress(); }
549
550 uint64 GetLastUsedGarbageCollectCycle() const { return LastUsedGarbageCollectCycle; }
551
552 uint64 GetCommitSize() const { return CommitSize; }
553
554 bool IsEmpty() const { return Allocator.IsEmpty(); }
555
556 bool IsFull() const { return Allocator.IsFull(); }
557
558 bool IsCommitRequired() const { return CommitSize > 0; }
559
561 {
562 return Size <= Allocator.GetFreeSize() && EnumHasAnyFlags(Initializer.Flags, Flags);
563 }
564
565protected:
570
571private:
572 RHICORE_API void AllocateMemoryInternal(FRHITransientResource* Resource, const FRHITransientHeapAllocation& Allocation);
573 RHICORE_API void DeallocateMemoryInternal(FRHITransientResource* Resource, const FRHITransientAllocationFences& Fences);
574
575 FInitializer Initializer;
577
578 uint64 LastUsedGarbageCollectCycle = 0;
579 uint64 CommitSize = 0;
580 uint64 CommitSizeMax = 0;
581 uint32 AlignmentLog2;
582
584
588
591};
592
594
603{
604public:
606 {
607 // Creates a default initializer using common RHI CVars.
609
611
612 // The minimum size to use when creating the first heap. This is the default but can grow based on allocations.
614
615 // The minimum size to use when creating a heap. This is the default but can grow based on allocations.
617
618 // The minimum alignment for resources in the heap.
620
621 // The latency between the completed fence value and the used fence value to invoke garbage collection of the heap.
623
624 // Size of the texture cache before elements are evicted.
626
627 // Size of the buffer cache before elements are evicted.
629
630 // Whether all heaps should be created with the AllowAll heap flag.
632
633 // Whether all heaps support mapping physical pages to the commit size. If false the physical memory usage is represented by the capacity instead.
635 };
636
640
642
644
646
647 RHICORE_API void GarbageCollect() override;
648
649 const FInitializer& GetInitializer() const { return Initializer; }
650
651 uint64 GetGarbageCollectCycle() const { return GarbageCollectCycle; }
652
654 {
655 return FMath::Max(FMath::RoundUpToPowerOfTwo64(RequestedHeapSize), Initializer.MinimumHeapSize);
656 }
657
658private:
661
662 // Called when a new heap is being created and added to the pool.
663 virtual FRHITransientHeap* CreateHeap(const FRHITransientHeap::FInitializer& Initializer) = 0;
664
666
667 FInitializer Initializer;
669
670 FCriticalSection CriticalSection;
673 uint64 GarbageCollectCycle = 0;
674
676};
677
680{
681public:
684
685 // Sets the create mode for allocations.
687
688 // Deallocates a texture from its parent heap. Provide the current platform fence value used to update the heap.
690
691 // Deallocates a buffer from its parent heap. Provide the current platform fence value used to update the heap.
693
694 // Called to flush any active allocations prior to rendering.
696
697 // Returns the array of heaps used by this allocator, including the required commit size for each.
698 inline TConstArrayView<FRHITransientHeap*> GetHeaps() const { return Heaps; }
699
701
702 template <typename TransientResourceType, typename LambdaType, typename ResourceCreateInfo>
704 {
705 TransientResourceType* Resource;
707 {
708 typename TransientResourceType::FResourceTaskResult TaskResult = Lambda();
709 Resource = new TransientResourceType(TaskResult.Resource.GetReference(), TaskResult.GpuVirtualAddress, Hash, Size, ERHITransientAllocationType::Heap, CreateInfo);
710 }
711 else
712 {
714 }
715 return Resource;
716 }
717
718protected:
725 const FRHITextureCreateInfo& CreateInfo,
726 const TCHAR* DebugName,
727 const FRHITransientAllocationFences& Fences,
728 uint64 TextureSize,
731
738 const FRHIBufferCreateInfo& CreateInfo,
739 const TCHAR* DebugName,
740 const FRHITransientAllocationFences& Fences,
741 uint32 BufferSize,
742 uint32 BufferAlignment,
744
745private:
747 uint64 CurrentCycle = 0;
748 uint32 DeallocationCount = 0;
750
752};
753
757
760
763{
764public:
766 : MaxSpanCount(InPageCount + 2)
767 , MaxPageCount(InPageCount)
768 , PageSize(InPageSize)
769 {
770 Init();
771 }
772
773 RHICORE_API void Reset();
774
775 RHICORE_API bool Allocate(FRHITransientResource* Resource, const FRHITransientAllocationFences& Fences, uint32 PageCount, uint32& NumPagesAllocated, uint32& OutSpanIndex);
776
777 RHICORE_API void Deallocate(FRHITransientResource* Resource, const FRHITransientAllocationFences& Fences, uint32 SpanIndex);
778
779 RHICORE_API void Flush();
780
781 template <typename SpanArrayType>
783 {
784 check(SpanIndex != InvalidIndex);
785 do
786 {
787 OutPageSpans.Emplace(PageSpans[SpanIndex]);
788 SpanIndex = PageSpans[SpanIndex].NextSpanIndex;
789 } while (SpanIndex != InvalidIndex);
790 }
791
792 uint32 GetAllocationCount() const { return AllocationCount; }
793
794 uint32 GetFreePageCount() const { return FreePageCount; }
795
796 uint64 GetUsedSize() const { return (MaxPageCount - FreePageCount) * PageSize; }
797
798 uint64 GetFreeSize() const { return FreePageCount * PageSize; }
799
801
802 uint32 GetMaxSpanCount() const { return MaxSpanCount; }
803
804 uint32 GetPageSize() const { return PageSize; }
805
806 uint64 GetCapacity() const { return MaxPageCount * PageSize; }
807
808 bool IsFull() const { return FreePageCount == 0; }
809
810 bool IsEmpty() const { return AllocationCount == 0; }
811
812private:
813 static const uint32 InvalidIndex = TNumericLimits<uint32>::Max();
814 static const uint32 FreeSpanListHeadIndex = 0;
815 static const uint32 FreeSpanListTailIndex = 1;
816
817 struct FPageSpan : FRHITransientPageSpan
818 {
819 const bool IsLinked() { return (NextSpanIndex != InvalidIndex || PrevSpanIndex != InvalidIndex); }
820
821 FRHITransientResource* Resource = nullptr;
823 uint32 NextSpanIndex = InvalidIndex;
824 uint32 PrevSpanIndex = 0;
825 bool bAllocated = false;
826 };
827
828 RHICORE_API void Init();
829
830 // Splits a span into two, so that the original span has PageCount pages and the new span contains the remaining ones
831 RHICORE_API void SplitSpan(uint32 SpanIndex, uint32 PageCount);
832
833 // Merges two spans. They must be adjacent and in the same list
835
836 // Inserts a span after an existing span. The span to insert must be unlinked
838
839 // Inserts a span after an existing span. The span to insert must be unlinked
841
842 // Removes a span from its list, reconnecting neighbouring list elements
843 RHICORE_API void Unlink(uint32 SpanIndex);
844
845 // Allocates an unused span from the pool
846 int AllocSpan()
847 {
848 check(UnusedSpanListCount > 0);
849 uint32 SpanIndex = UnusedSpanList[UnusedSpanListCount - 1];
850 UnusedSpanListCount--;
851 return SpanIndex;
852 }
853
854 // Releases a span back to the unused pool
855 void ReleaseSpan(uint32 SpanIndex)
856 {
857 check(!PageSpans[SpanIndex].IsLinked());
858 UnusedSpanList[UnusedSpanListCount] = SpanIndex;
859 UnusedSpanListCount++;
860 check(UnusedSpanListCount <= MaxPageCount);
861 }
862
863 RHICORE_API void Validate();
864
865 uint32 GetFirstSpanIndex() const
866 {
867 return PageSpans[FreeSpanListHeadIndex].NextSpanIndex;
868 }
869
870 TArray<int32> PageToSpanStart; // [PAGE_COUNT + 1]
871 TArray<int32> PageToSpanEnd; // [PAGE_COUNT + 1]
872 TArray<FPageSpan> PageSpans; // [MAX_SPAN_COUNT]
873 TArray<int32> UnusedSpanList; // [MAX_SPAN_COUNT]
874
875 uint32 FreePageCount;
876 uint32 UnusedSpanListCount;
877
878 const uint32 MaxSpanCount;
879 const uint32 MaxPageCount;
880 const uint32 PageSize;
881 uint32 AllocationCount;
882};
883
885
887{
888public:
890 {
893 };
894
897 , Allocator(Initializer.PageCount, Initializer.PageSize)
898 {}
899
900 virtual ~FRHITransientPagePool() = default;
901
936
938
940 {
941 Allocator.Deallocate(Resource, Fences, SpanIndex);
942 }
943
945
946 uint64 GetLastUsedGarbageCollectCycle() const { return LastUsedGarbageCollectCycle; }
947
948 bool IsEmpty() const { return Allocator.IsEmpty(); }
949
950 bool IsFull() const { return Allocator.IsFull(); }
951
952 uint64 GetCapacity() const { return Allocator.GetCapacity(); }
953
954 uint64 GetGpuVirtualAddress() const { return GpuVirtualAddress; }
955
979
981
982protected:
988
989private:
992
994
996
998
999 TArray<FPageMapRequest> PageMapRequests;
1001 uint64 GpuVirtualAddress = 0;
1002 uint64 LastUsedGarbageCollectCycle = 0;
1003 uint32 PageMapRequestCountMax = 0;
1004 uint32 PageSpanCountMax = 0;
1005
1008};
1009
1011
1013{
1014public:
1016 {
1017 // Creates a default initializer using common RHI CVars.
1019
1021
1022 // Size in bytes of the pool. Must be a multiple of PageSize.
1024
1025 // Size in bytes of the first pool. Only takes effect if larger than PoolSize.
1027
1028 // Size of each page.
1030
1031 // The latency between the completed fence value and the used fence value to invoke garbage collection of the heap.
1033
1034 // Size of the texture cache before elements are evicted.
1036
1037 // Size of the buffer cache before elements are evicted.
1039 };
1040
1044
1046
1048
1049 // Called by the transient allocator to acquire a page pool from the cache.
1051
1052 // Called by the transient allocator to return the fast page pool if it exists.
1054
1055 // Called by the transient allocator to forfeit all acquired heaps back to the cache.
1057
1058 RHICORE_API void GarbageCollect() override;
1059
1061
1062private:
1065
1066 // Called to access the dedicated fast VRAM page pool, if it exists on the platform.
1067 virtual FRHITransientPagePool* CreateFastPagePool() { return nullptr; }
1068
1069 // Called when a new heap is being created and added to the pool.
1070 virtual FRHITransientPagePool* CreatePagePool(const FRHITransientPagePool::FInitializer& Initializer) = 0;
1071
1073
1075
1076 FCriticalSection CriticalSection;
1077 FRHITransientPagePool* FastPagePool = nullptr;
1080 uint64 GarbageCollectCycle = 0;
1081 uint64 TotalMemoryCapacity = 0;
1082
1084};
1085
1087
1089{
1090public:
1093 , Textures(InPagePoolCache.Initializer.TextureCacheSize, ResourceCacheGarbageCollectionLatency)
1094 , Buffers(InPagePoolCache.Initializer.BufferCacheSize, ResourceCacheGarbageCollectionLatency)
1095 , PageSize(PagePoolCache.Initializer.PageSize)
1096 {
1097 FastPagePool = PagePoolCache.GetFastPagePool();
1098 }
1099
1100 RHICORE_API FRHITransientTexture* CreateTexture(const FRHITextureCreateInfo& CreateInfo, const TCHAR* DebugName, const FRHITransientAllocationFences& Fences) override;
1101 RHICORE_API FRHITransientBuffer* CreateBuffer(const FRHIBufferCreateInfo& CreateInfo, const TCHAR* DebugName, const FRHITransientAllocationFences& Fences) override;
1105
1106 uint32 GetPageSize() const { return PageSize; }
1107
1108 uint32 GetPagePoolCount() const { return PagePools.Num(); }
1109
1111
1112private:
1113 static constexpr uint32 ResourceCacheGarbageCollectionLatency = 2;
1114 static constexpr uint64 KB = 1024;
1115 static constexpr uint64 MB = 1024 * KB;
1116
1117 RHICORE_API void AllocateMemoryInternal(FRHITransientResource* Resource, const TCHAR* DebugName, const FRHITransientAllocationFences& Fences, bool bFastPoolRequested, float FastPoolPercentageRequested);
1118 RHICORE_API void DeallocateMemoryInternal(FRHITransientResource* Resource, const FRHITransientAllocationFences& Fences);
1119
1122
1123 virtual FRHITransientTexture* CreateTextureInternal(
1124 const FRHITextureCreateInfo& CreateInfo,
1125 const TCHAR* DebugName,
1126 uint64 Hash) = 0;
1127
1128 virtual FRHITransientBuffer* CreateBufferInternal(
1129 const FRHIBufferCreateInfo& CreateInfo,
1130 const TCHAR* DebugName,
1131 uint64 Hash) = 0;
1132
1133 virtual void ReleaseTextureInternal(FRHITransientTexture* Texture) = 0;
1134 virtual void ReleaseBufferInternal(FRHITransientBuffer* Buffer) = 0;
1135
1137
1138 template <typename FunctionType>
1139 void EnumeratePageSpans(const FRHITransientResource* Resource, FunctionType Function) const
1140 {
1141 const FRHITransientPageAllocation& PageAllocation = Resource->GetPageAllocation();
1142
1143 for (const FRHITransientPagePoolAllocation& PoolAllocation : PageAllocation.PoolAllocations)
1144 {
1145 for (uint32 Index = PoolAllocation.SpanOffsetMin; Index < PoolAllocation.SpanOffsetMax; ++Index)
1146 {
1147 Function(PoolAllocation.Pool, PageAllocation.Spans[Index]);
1148 }
1149 }
1150 }
1151
1155
1157 FRHITransientPagePool* FastPagePool = nullptr;
1158 uint64 CurrentCycle = 0;
1159 uint32 FirstNormalPagePoolIndex = 0;
1160 uint32 DeallocationCount = 0;
1161 uint32 PageSize = 0;
1162 uint32 PageMapCount = 0;
1163 uint32 PageAllocateCount = 0;
1164 uint32 PageSpanCount = 0;
1165
1167};
constexpr T Align(T Val, uint64 Alignment)
Definition AlignmentTemplates.h:18
FClangPlatformMath FPlatformMath
Definition AndroidPlatformMath.h:10
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
#define check(expr)
Definition AssertionMacros.h:314
uint64 CityHash64(const char *s, uint32 len)
Definition CityHash.cpp:388
uint64 CityHash64WithSeed(const char *s, uint32 len, uint64 seed)
Definition CityHash.cpp:430
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
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
#define TRACE_CPUPROFILER_EVENT_SCOPE(Name)
Definition CpuProfilerTrace.h:528
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
constexpr bool EnumHasAnyFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:35
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define UE_SOURCE_LOCATION
Definition PreprocessorHelpers.h:71
uint64 ComputeHash(const FRHITextureCreateInfo &InCreateInfo, uint64 HeapOffset)
Definition RHICoreTransientResourceAllocator.h:15
ERHITransientHeapFlags
Definition RHICoreTransientResourceAllocator.h:443
#define IF_RHICORE_TRANSIENT_ALLOCATOR_DEBUG(Op)
Definition RHICoreTransientResourceAllocator.h:10
ERHITransientResourceCreateMode
Definition RHITransientResourceAllocator.h:527
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Offset
Definition VulkanMemory.cpp:4033
uint32 Size
Definition VulkanMemory.cpp:4034
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 RHICommandList.h:4626
Definition RHITransientResourceAllocator.h:23
Definition RHITransientResourceAllocator.h:489
Definition RHITransientResourceAllocator.h:441
Definition RHICoreTransientResourceAllocator.h:317
RHICORE_API void Flush()
Definition RHICoreTransientResourceAllocator.cpp:298
bool IsFull() const
Definition RHICoreTransientResourceAllocator.h:351
uint64 GetGpuVirtualAddress() const
Definition RHICoreTransientResourceAllocator.h:344
uint64 GetFreeSize() const
Definition RHICoreTransientResourceAllocator.h:347
RHICORE_API FRHITransientHeapAllocation Allocate(const FRHITransientAllocationFences &Fences, uint64 Size, uint32 Alignment, TArray< FAliasingOverlap > &OutAliasingOverlaps)
Definition RHICoreTransientResourceAllocator.cpp:132
void SetGpuVirtualAddress(uint64 InGpuVirtualAddress)
Definition RHICoreTransientResourceAllocator.h:339
uint64 GetAlignmentWaste() const
Definition RHICoreTransientResourceAllocator.h:348
uint64 GetUsedSize() const
Definition RHICoreTransientResourceAllocator.h:346
uint64 GetCapacity() const
Definition RHICoreTransientResourceAllocator.h:345
bool IsEmpty() const
Definition RHICoreTransientResourceAllocator.h:352
RHICORE_API void Deallocate(FRHITransientResource *Resource, const FRHITransientAllocationFences &Fences)
Definition RHICoreTransientResourceAllocator.cpp:261
uint32 GetAllocationCount() const
Definition RHICoreTransientResourceAllocator.h:349
Definition RHICoreTransientResourceAllocator.h:603
RHICORE_API void GarbageCollect() override
Definition RHICoreTransientResourceAllocator.cpp:595
uint64 GetGarbageCollectCycle() const
Definition RHICoreTransientResourceAllocator.h:651
FRHITransientHeapCache(const FInitializer &InInitializer)
Definition RHICoreTransientResourceAllocator.h:637
virtual RHICORE_API ~FRHITransientHeapCache()
Definition RHICoreTransientResourceAllocator.cpp:530
RHICORE_API FRHITransientHeap * Acquire(uint64 FirstAllocationSize, ERHITransientHeapFlags FirstAllocationHeapFlags)
Definition RHICoreTransientResourceAllocator.cpp:540
const FInitializer & GetInitializer() const
Definition RHICoreTransientResourceAllocator.h:649
RHICORE_API void Forfeit(TConstArrayView< FRHITransientHeap * > Heaps)
Definition RHICoreTransientResourceAllocator.cpp:581
uint64 GetHeapSize(uint64 RequestedHeapSize) const
Definition RHICoreTransientResourceAllocator.h:653
Definition RHICoreTransientResourceAllocator.h:467
uint64 GetCapacity() const
Definition RHICoreTransientResourceAllocator.h:546
uint64 GetCommitSize() const
Definition RHICoreTransientResourceAllocator.h:552
FRHITransientHeap(const FInitializer &InInitializer)
Definition RHICoreTransientResourceAllocator.h:508
bool IsFull() const
Definition RHICoreTransientResourceAllocator.h:556
bool IsEmpty() const
Definition RHICoreTransientResourceAllocator.h:554
bool IsAllocationSupported(uint64 Size, ERHITransientHeapFlags Flags) const
Definition RHICoreTransientResourceAllocator.h:560
uint64 GetLastUsedGarbageCollectCycle() const
Definition RHICoreTransientResourceAllocator.h:550
const FInitializer & GetInitializer() const
Definition RHICoreTransientResourceAllocator.h:544
bool IsCommitRequired() const
Definition RHICoreTransientResourceAllocator.h:558
RHICORE_API FRHITransientBuffer * CreateBuffer(const FRHIBufferCreateInfo &CreateInfo, const TCHAR *DebugName, const FRHITransientAllocationFences &Fences, uint64 CurrentAllocatorCycle, uint64 BufferSize, uint32 BufferAlignment, FCreateBufferFunction CreateBufferFunction)
Definition RHICoreTransientResourceAllocator.cpp:394
void SetGpuVirtualAddress(uint64 InBaseGPUVirtualAddress)
Definition RHICoreTransientResourceAllocator.h:566
uint64 GetGPUVirtualAddress() const
Definition RHICoreTransientResourceAllocator.h:548
RHICORE_API FRHITransientTexture * CreateTexture(const FRHITextureCreateInfo &CreateInfo, const TCHAR *DebugName, const FRHITransientAllocationFences &Fences, uint64 CurrentAllocatorCycle, uint64 TextureSize, uint32 TextureAlignment, FCreateTextureFunction CreateTextureFunction)
Definition RHICoreTransientResourceAllocator.cpp:358
RHICORE_API void DeallocateMemory(FRHITransientTexture *Texture, const FRHITransientAllocationFences &Fences)
Definition RHICoreTransientResourceAllocator.cpp:388
virtual ~FRHITransientHeap()=default
Definition RHICoreTransientResourceAllocator.h:1013
virtual RHICORE_API ~FRHITransientPagePoolCache()
Definition RHICoreTransientResourceAllocator.cpp:1283
FRHITransientPagePoolCache(const FRHITransientPagePoolCache &)=delete
FRHITransientPagePoolCache(const FInitializer &InInitializer)
Definition RHICoreTransientResourceAllocator.h:1041
const FInitializer Initializer
Definition RHICoreTransientResourceAllocator.h:1060
RHICORE_API FRHITransientPagePool * Acquire()
Definition RHICoreTransientResourceAllocator.cpp:1296
RHICORE_API void GarbageCollect() override
Definition RHICoreTransientResourceAllocator.cpp:1359
RHICORE_API FRHITransientPagePool * GetFastPagePool()
Definition RHICoreTransientResourceAllocator.cpp:1328
RHICORE_API void Forfeit(TConstArrayView< FRHITransientPagePool * > PagePools)
Definition RHICoreTransientResourceAllocator.cpp:1345
Definition RHICoreTransientResourceAllocator.h:887
FRHITransientPagePool(const FInitializer &InInitializer)
Definition RHICoreTransientResourceAllocator.h:895
bool IsEmpty() const
Definition RHICoreTransientResourceAllocator.h:948
uint64 GetGpuVirtualAddress() const
Definition RHICoreTransientResourceAllocator.h:954
uint64 GetCapacity() const
Definition RHICoreTransientResourceAllocator.h:952
void Deallocate(FRHITransientResource *Resource, const FRHITransientAllocationFences &Fences, uint32 SpanIndex)
Definition RHICoreTransientResourceAllocator.h:939
virtual ~FRHITransientPagePool()=default
uint64 GetLastUsedGarbageCollectCycle() const
Definition RHICoreTransientResourceAllocator.h:946
bool IsFull() const
Definition RHICoreTransientResourceAllocator.h:950
RHICORE_API void Allocate(FAllocationContext &AllocationContext)
Definition RHICoreTransientResourceAllocator.cpp:1201
const FInitializer Initializer
Definition RHICoreTransientResourceAllocator.h:980
void SetGpuVirtualAddress(uint64 InGpuVirtualAddress)
Definition RHICoreTransientResourceAllocator.h:983
Definition RHICoreTransientResourceAllocator.h:763
RHICORE_API void Deallocate(FRHITransientResource *Resource, const FRHITransientAllocationFences &Fences, uint32 SpanIndex)
Definition RHICoreTransientResourceAllocator.cpp:979
uint32 GetFreePageCount() const
Definition RHICoreTransientResourceAllocator.h:794
uint64 GetCapacity() const
Definition RHICoreTransientResourceAllocator.h:806
uint32 GetAllocationCount() const
Definition RHICoreTransientResourceAllocator.h:792
bool IsEmpty() const
Definition RHICoreTransientResourceAllocator.h:810
bool IsFull() const
Definition RHICoreTransientResourceAllocator.h:808
RHICORE_API uint32 GetAllocationPageCount(uint32 SpanIndex) const
Definition RHICoreTransientResourceAllocator.cpp:1157
uint64 GetFreeSize() const
Definition RHICoreTransientResourceAllocator.h:798
uint32 GetPageSize() const
Definition RHICoreTransientResourceAllocator.h:804
RHICORE_API void Flush()
Definition RHICoreTransientResourceAllocator.cpp:1056
void GetSpanArray(uint32 SpanIndex, SpanArrayType &OutPageSpans) const
Definition RHICoreTransientResourceAllocator.h:782
RHICORE_API void Reset()
Definition RHICoreTransientResourceAllocator.cpp:846
FRHITransientPageSpanAllocator(uint32 InPageCount, uint32 InPageSize)
Definition RHICoreTransientResourceAllocator.h:765
RHICORE_API bool Allocate(FRHITransientResource *Resource, const FRHITransientAllocationFences &Fences, uint32 PageCount, uint32 &NumPagesAllocated, uint32 &OutSpanIndex)
Definition RHICoreTransientResourceAllocator.cpp:907
uint64 GetUsedSize() const
Definition RHICoreTransientResourceAllocator.h:796
uint32 GetMaxSpanCount() const
Definition RHICoreTransientResourceAllocator.h:802
Definition RHICoreTransientResourceAllocator.h:680
RHICORE_API ~FRHITransientResourceHeapAllocator()
FRHITransientHeapCache & HeapCache
Definition RHICoreTransientResourceAllocator.h:700
TransientResourceType * CreateTransientResource(LambdaType &&Lambda, uint64 Hash, uint64 Size, const ResourceCreateInfo &CreateInfo)
Definition RHICoreTransientResourceAllocator.h:703
TConstArrayView< FRHITransientHeap * > GetHeaps() const
Definition RHICoreTransientResourceAllocator.h:698
RHICORE_API FRHITransientBuffer * CreateBufferInternal(const FRHIBufferCreateInfo &CreateInfo, const TCHAR *DebugName, const FRHITransientAllocationFences &Fences, uint32 BufferSize, uint32 BufferAlignment, FRHITransientHeap::FCreateBufferFunction CreateBufferFunction)
Definition RHICoreTransientResourceAllocator.cpp:685
RHICORE_API FRHITransientTexture * CreateTextureInternal(const FRHITextureCreateInfo &CreateInfo, const TCHAR *DebugName, const FRHITransientAllocationFences &Fences, uint64 TextureSize, uint32 TextureAlignment, FRHITransientHeap::FCreateTextureFunction CreateTextureFunction)
Definition RHICoreTransientResourceAllocator.cpp:636
RHICORE_API void DeallocateMemory(FRHITransientTexture *Texture, const FRHITransientAllocationFences &Fences) override
Definition RHICoreTransientResourceAllocator.cpp:735
RHICORE_API void SetCreateMode(ERHITransientResourceCreateMode InCreateMode) override
Definition RHICoreTransientResourceAllocator.cpp:765
Definition RHICoreTransientResourceAllocator.h:1089
FRHITransientResourcePageAllocator(FRHITransientPagePoolCache &InPagePoolCache)
Definition RHICoreTransientResourceAllocator.h:1091
uint32 GetPageSize() const
Definition RHICoreTransientResourceAllocator.h:1106
RHICORE_API FRHITransientTexture * CreateTexture(const FRHITextureCreateInfo &CreateInfo, const TCHAR *DebugName, const FRHITransientAllocationFences &Fences) override
Definition RHICoreTransientResourceAllocator.cpp:1400
uint32 GetPagePoolCount() const
Definition RHICoreTransientResourceAllocator.h:1108
RHICORE_API FRHITransientBuffer * CreateBuffer(const FRHIBufferCreateInfo &CreateInfo, const TCHAR *DebugName, const FRHITransientAllocationFences &Fences) override
Definition RHICoreTransientResourceAllocator.cpp:1422
RHICORE_API void DeallocateMemory(FRHITransientTexture *Texture, const FRHITransientAllocationFences &Fences) override
Definition RHICoreTransientResourceAllocator.cpp:1488
FRHITransientPagePoolCache & PagePoolCache
Definition RHICoreTransientResourceAllocator.h:1110
Definition RHITransientResourceAllocator.h:190
FRHITransientPageAllocation & GetPageAllocation()
Definition RHITransientResourceAllocator.h:292
uint64 GetHash() const
Definition RHITransientResourceAllocator.h:319
Definition RHITransientResourceAllocator.h:399
Definition RHICoreTransientResourceAllocator.h:301
virtual void GarbageCollect()=0
virtual ~IRHITransientMemoryCache()=default
Definition RHITransientResourceAllocator.h:536
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_FORCEINLINE_HINT void RemoveAtSwap(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2185
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
UE_FORCEINLINE_HINT SizeType Emplace(ArgsType &&... Args)
Definition Array.h:2561
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2308
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
ElementType Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:1196
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Top() UE_LIFETIMEBOUND
Definition Array.h:1248
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition AndroidPlatformMisc.h:14
Definition RHICoreTransientResourceAllocator.h:155
void Forfeit(uint64 CurrentFrameIndex, ReleaseFunctionType ReleaseFunction)
Definition RHICoreTransientResourceAllocator.h:211
uint32 GetHitCount() const
Definition RHICoreTransientResourceAllocator.h:253
TransientResourceType * Acquire(uint64 Hash, CreateFunctionType CreateFunction)
Definition RHICoreTransientResourceAllocator.h:187
TRHITransientResourceCache(uint32 InCapacity=kDefaultCapacity, uint32 InGarbageCollectLatency=kDefaultGarbageCollectLatency)
Definition RHICoreTransientResourceAllocator.h:161
static const uint32 kInfinity
Definition RHICoreTransientResourceAllocator.h:157
void Forfeit(uint64 CurrentFrameIndex)
Definition RHICoreTransientResourceAllocator.h:240
static const uint32 kDefaultGarbageCollectLatency
Definition RHICoreTransientResourceAllocator.h:159
static const uint32 kDefaultCapacity
Definition RHICoreTransientResourceAllocator.h:158
uint32 GetSize() const
Definition RHICoreTransientResourceAllocator.h:249
uint32 GetCapacity() const
Definition RHICoreTransientResourceAllocator.h:251
TConstArrayView< TransientResourceType * > GetAllocated() const
Definition RHICoreTransientResourceAllocator.h:245
float GetHitPercentage() const
Definition RHICoreTransientResourceAllocator.h:257
uint32 GetAllocatedCount() const
Definition RHICoreTransientResourceAllocator.h:247
~TRHITransientResourceCache()
Definition RHICoreTransientResourceAllocator.h:173
uint32 GetMissCount() const
Definition RHICoreTransientResourceAllocator.h:255
#define KB
Definition lz4.cpp:242
UE_REWRITE void Sort(RangeType &&Range)
Definition Sort.h:16
IndexType Partition(T *Elements, const IndexType Num, UnaryPredicate Predicate)
Definition Partition.h:18
const FVector Offset(0, 0, 20)
TTask< TInvokeResult_T< TaskBodyType > > Launch(const TCHAR *DebugName, TaskBodyType &&TaskBody, ETaskPriority Priority=ETaskPriority::Normal, EExtendedTaskPriority ExtendedPriority=EExtendedTaskPriority::None, ETaskFlags Flags=ETaskFlags::None)
Definition Task.h:266
U16 Index
Definition radfft.cpp:71
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition GenericPlatformMemory.h:586
Definition RHIResources.h:1321
Definition RHIResources.h:1689
Definition RHITransientResourceAllocator.h:161
Definition RHICoreTransientResourceAllocator.h:320
uint32 AcquireFence
Definition RHICoreTransientResourceAllocator.h:328
FAliasingOverlap(FRHITransientResource *InResource, uint32 InAcquireFence)
Definition RHICoreTransientResourceAllocator.h:322
FRHITransientResource * Resource
Definition RHICoreTransientResourceAllocator.h:327
Definition RHICoreTransientResourceAllocator.h:606
uint32 HeapAlignment
Definition RHICoreTransientResourceAllocator.h:619
bool bSupportsVirtualMapping
Definition RHICoreTransientResourceAllocator.h:634
uint32 GarbageCollectLatency
Definition RHICoreTransientResourceAllocator.h:622
uint64 MinimumFirstHeapSize
Definition RHICoreTransientResourceAllocator.h:613
static RHICORE_API FInitializer CreateDefault()
Definition RHICoreTransientResourceAllocator.cpp:519
uint32 TextureCacheSize
Definition RHICoreTransientResourceAllocator.h:625
bool bSupportsAllHeapFlags
Definition RHICoreTransientResourceAllocator.h:631
uint32 BufferCacheSize
Definition RHICoreTransientResourceAllocator.h:628
static const uint32 kDefaultResourceCacheSize
Definition RHICoreTransientResourceAllocator.h:610
uint64 MinimumHeapSize
Definition RHICoreTransientResourceAllocator.h:616
Definition RHICoreTransientResourceAllocator.h:470
uint32 TextureCacheSize
Definition RHICoreTransientResourceAllocator.h:481
ERHITransientHeapFlags Flags
Definition RHICoreTransientResourceAllocator.h:478
uint64 Size
Definition RHICoreTransientResourceAllocator.h:472
uint32 Alignment
Definition RHICoreTransientResourceAllocator.h:475
uint32 BufferCacheSize
Definition RHICoreTransientResourceAllocator.h:484
Definition RHICoreTransientResourceAllocator.h:488
const uint64 Hash
Definition RHICoreTransientResourceAllocator.h:502
FRHITransientHeap & Heap
Definition RHICoreTransientResourceAllocator.h:496
const FRHITransientHeapAllocation & Allocation
Definition RHICoreTransientResourceAllocator.h:499
FResourceInitializer(const FRHITransientHeapAllocation &InAllocation, uint64 InHash)
Definition RHICoreTransientResourceAllocator.h:489
Definition RHICoreTransientResourceAllocator.h:90
FRHITransientMemoryStats()=default
uint64 AliasedSizeCurrent
Definition RHICoreTransientResourceAllocator.h:142
void AllocateBuffer(uint64 Size)
Definition RHICoreTransientResourceAllocator.h:114
void AllocateTexture(uint64 Size)
Definition RHICoreTransientResourceAllocator.h:101
void Reset()
Definition RHICoreTransientResourceAllocator.h:127
FRHITransientResourceStats Textures
Definition RHICoreTransientResourceAllocator.h:138
uint64 AliasedSize
Definition RHICoreTransientResourceAllocator.h:145
bool HasDeallocations() const
Definition RHICoreTransientResourceAllocator.h:136
void DeallocateBuffer(uint64 Size)
Definition RHICoreTransientResourceAllocator.h:121
RHICORE_API void Submit(uint64 TotalMemoryCapacity)
Definition RHICoreTransientResourceAllocator.cpp:90
FRHITransientResourceStats Buffers
Definition RHICoreTransientResourceAllocator.h:139
void DeallocateTexture(uint64 Size)
Definition RHICoreTransientResourceAllocator.h:108
void Accumulate(const FRHITransientMemoryStats &Other)
Definition RHICoreTransientResourceAllocator.h:94
Definition RHITransientResourceAllocator.h:151
TArray< FRHITransientPageSpan > Spans
Definition RHITransientResourceAllocator.h:156
Definition RHITransientResourceAllocator.h:132
Definition RHICoreTransientResourceAllocator.h:1016
static RHICORE_API FInitializer CreateDefault()
Definition RHICoreTransientResourceAllocator.cpp:1274
uint64 PoolSize
Definition RHICoreTransientResourceAllocator.h:1023
uint64 PoolSizeFirst
Definition RHICoreTransientResourceAllocator.h:1026
uint32 BufferCacheSize
Definition RHICoreTransientResourceAllocator.h:1038
uint32 TextureCacheSize
Definition RHICoreTransientResourceAllocator.h:1035
uint32 PageSize
Definition RHICoreTransientResourceAllocator.h:1029
static const uint32 kDefaultResourceCacheSize
Definition RHICoreTransientResourceAllocator.h:1020
uint32 GarbageCollectLatency
Definition RHICoreTransientResourceAllocator.h:1032
Definition RHICoreTransientResourceAllocator.h:903
uint32 AllocationCount
Definition RHICoreTransientResourceAllocator.h:928
uint32 PagesMapped
Definition RHICoreTransientResourceAllocator.h:934
uint32 AllocationMatchingCount
Definition RHICoreTransientResourceAllocator.h:929
uint32 PagesAllocated
Definition RHICoreTransientResourceAllocator.h:932
const TArray< FRHITransientPagePoolAllocation, TInlineAllocator< 8 > > AllocationsBefore
Definition RHICoreTransientResourceAllocator.h:923
TArray< FRHITransientPagePoolAllocation > & Allocations
Definition RHICoreTransientResourceAllocator.h:921
bool IsComplete() const
Definition RHICoreTransientResourceAllocator.h:918
uint32 MaxAllocationPage
Definition RHICoreTransientResourceAllocator.h:931
uint32 PageSpansAllocated
Definition RHICoreTransientResourceAllocator.h:933
const FRHITransientAllocationFences Fences
Definition RHICoreTransientResourceAllocator.h:926
const uint64 Size
Definition RHICoreTransientResourceAllocator.h:925
FAllocationContext(FRHITransientResource &InResource, const FRHITransientAllocationFences &InFences, uint32 InPageSize)
Definition RHICoreTransientResourceAllocator.h:904
const uint64 GpuVirtualAddress
Definition RHICoreTransientResourceAllocator.h:924
TArray< FRHITransientPageSpan > & Spans
Definition RHICoreTransientResourceAllocator.h:922
uint32 PagesRemaining
Definition RHICoreTransientResourceAllocator.h:930
FRHITransientResource & Resource
Definition RHICoreTransientResourceAllocator.h:920
Definition RHICoreTransientResourceAllocator.h:890
uint32 PageSize
Definition RHICoreTransientResourceAllocator.h:892
uint32 PageCount
Definition RHICoreTransientResourceAllocator.h:891
Definition RHICoreTransientResourceAllocator.h:957
uint32 SourcePageCount
Definition RHICoreTransientResourceAllocator.h:975
uint32 PageSpanCount
Definition RHICoreTransientResourceAllocator.h:977
uint64 DestinationAddress
Definition RHICoreTransientResourceAllocator.h:973
FPageMapRequest(uint64 InDestinationAddress, uint64 InSourcePagePoolAddress, uint32 InSourcePageCount, uint32 InPageSpanOffset, uint32 InPageSpanCount)
Definition RHICoreTransientResourceAllocator.h:960
uint64 SourcePagePoolAddress
Definition RHICoreTransientResourceAllocator.h:974
uint32 PageSpanOffset
Definition RHICoreTransientResourceAllocator.h:976
Definition RHITransientResourceAllocator.h:122
Definition RHICoreTransientResourceAllocator.h:53
uint32 AllocationCount
Definition RHICoreTransientResourceAllocator.h:79
void Add(const FRHITransientResourceStats &Other)
Definition RHICoreTransientResourceAllocator.h:56
FRHITransientResourceStats()=default
void Deallocate(uint64 Size)
Definition RHICoreTransientResourceAllocator.h:70
uint64 AllocatedSize
Definition RHICoreTransientResourceAllocator.h:76
void Allocate(uint64 Size)
Definition RHICoreTransientResourceAllocator.h:64
uint32 CreateCount
Definition RHICoreTransientResourceAllocator.h:85
uint32 DeallocationCount
Definition RHICoreTransientResourceAllocator.h:82
Definition OpenGLBuffer.cpp:37
Definition NumericLimits.h:41