UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMetalBufferPoolPolicyData Class Reference

#include <MetalBuffer.h>

Public Types

enum  {
  NumResourceStorageModes = 4 , NumSafeFrames = 1 , NumPoolBucketSizes = NumBucketSizes , NumPoolBuckets = NumPoolBucketSizes * NumResourceStorageModes ,
  NumToDrainPerFrame = 65536 , CullAfterFramesNum = 30
}
 
typedef FMetalPooledBufferArgs CreationArguments
 

Public Member Functions

uint32 GetPoolBucketIndex (CreationArguments Args)
 
uint32 GetPoolBucketSize (uint32 Bucket)
 
MTL::Buffer * CreateResource (FRHICommandListBase &RHICmdList, CreationArguments Args)
 
CreationArguments GetCreationArguments (MTL::Buffer *Resource)
 
void FreeResource (MTL::Buffer *Resource)
 

Member Typedef Documentation

◆ CreationArguments

Member Enumeration Documentation

◆ anonymous enum

Enumerator
NumResourceStorageModes 
NumSafeFrames 
NumPoolBucketSizes 

Number of frames to leave buffers before reclaiming/reusing

NumPoolBuckets 

Number of pool bucket sizes

NumToDrainPerFrame 

Number of pool bucket sizes - all entries must use consistent ResourceOptions, so the total number of pool buckets is the number of pool bucket sizes x the number of resource storage modes

CullAfterFramesNum 

Max. number of resources to cull in a single frame

Member Function Documentation

◆ CreateResource()

MTL::Buffer * FMetalBufferPoolPolicyData::CreateResource ( FRHICommandListBase RHICmdList,
CreationArguments  Args 
)

Creates the resource

Parameters
ArgsThe buffer size in bytes.
Returns
A suitably sized buffer or NULL on failure.

◆ FreeResource()

void FMetalBufferPoolPolicyData::FreeResource ( MTL::Buffer *  Resource)

Frees the resource

Parameters
ResourceThe buffer to prepare for release from the pool permanently.

◆ GetCreationArguments()

FMetalBufferPoolPolicyData::CreationArguments FMetalBufferPoolPolicyData::GetCreationArguments ( MTL::Buffer *  Resource)

Gets the arguments used to create resource

Parameters
ResourceThe buffer to get data for.
Returns
The arguments used to create the buffer.

◆ GetPoolBucketIndex()

uint32 FMetalBufferPoolPolicyData::GetPoolBucketIndex ( CreationArguments  Args)

Get the pool bucket index from the size

Parameters
Sizethe number of bytes for the resource
Returns
The bucket index.

◆ GetPoolBucketSize()

uint32 FMetalBufferPoolPolicyData::GetPoolBucketSize ( uint32  Bucket)

Get the pool bucket size from the index

Parameters
Bucketthe bucket index
Returns
The bucket size.

The documentation for this class was generated from the following files: