UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MetalTempAllocator.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "MetalRHI.h"
6#include "MetalBuffer.h"
7#import "MetalThirdParty.h"
8#include "Stats/Stats.h"
9
11class FMetalDevice;
12/*
13 Simple Temporary allocator that allocates from heaps
14 */
16{
17public:
19
21 void Cleanup();
22
23 virtual void ReleaseBuffer(FMetalBuffer*) override {}
24
25private:
26 struct FTempBufferInfo
27 {
28 MTL::Buffer* Buffer;
29 uint32_t Offset;
31 };
32
33 FMetalDevice& Device;
35
36 FCriticalSection AllocatorLock;
37
38 TStatId TotalAllocationStat;
39
40 uint32_t TotalAllocated = 0;
41 uint32_t MinAllocationSize = 0;
42 uint32_t TargetAllocationLimit = 0;
43 uint32_t Alignment;
44};
45
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
uint32 Size
Definition VulkanMemory.cpp:4034
Definition MetalResources.h:54
Definition MetalCommandBuffer.h:17
Definition MetalDevice.h:102
Definition MetalTempAllocator.h:16
FMetalBufferPtr Allocate(const uint32_t Size)
Definition MetalTempAllocator.cpp:18
void Cleanup()
Definition MetalTempAllocator.cpp:65
virtual void ReleaseBuffer(FMetalBuffer *) override
Definition MetalTempAllocator.h:23
Definition MetalBuffer.h:37
Definition Array.h:670
Definition LightweightStats.h:416