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

#include <MetalDynamicRHI.h>

+ Inheritance diagram for FMetalDynamicRHI:

Classes

struct  FProcessResult
 

Public Types

enum class  EQueueStatus { None = 0 , Processed = 1 << 0 , Pending = 1 << 1 }
 
- Public Types inherited from FDynamicRHI
using FRHICalcTextureSizeResult = ::FRHICalcTextureSizeResult
 

Public Member Functions

 FRIEND_ENUM_CLASS_FLAGS (EQueueStatus)
 
 FMetalDynamicRHI (ERHIFeatureLevel::Type RequestedFeatureLevel)
 
 ~FMetalDynamicRHI ()
 
virtual void Init ()
 
virtual void Shutdown ()
 
virtual const TCHARGetName () override
 
virtual void RHIEndFrame_RenderThread (FRHICommandListImmediate &RHICmdList) final override
 
virtual void RHIEndFrame (const FRHIEndFrameArgs &Args) final override
 
virtual FRHIShaderLibraryRef RHICreateShaderLibrary (EShaderPlatform Platform, FString const &FilePath, FString const &Name) final override
 
virtual FSamplerStateRHIRef RHICreateSamplerState (const FSamplerStateInitializerRHI &Initializer) final override
 
virtual FRasterizerStateRHIRef RHICreateRasterizerState (const FRasterizerStateInitializerRHI &Initializer) final override
 
virtual FDepthStencilStateRHIRef RHICreateDepthStencilState (const FDepthStencilStateInitializerRHI &Initializer) final override
 
virtual FBlendStateRHIRef RHICreateBlendState (const FBlendStateInitializerRHI &Initializer) final override
 
virtual FVertexDeclarationRHIRef RHICreateVertexDeclaration (const FVertexDeclarationElementList &Elements) final override
 
virtual FPixelShaderRHIRef RHICreatePixelShader (TArrayView< const uint8 > Code, const FSHAHash &Hash) final override
 
virtual FVertexShaderRHIRef RHICreateVertexShader (TArrayView< const uint8 > Code, const FSHAHash &Hash) final override
 
virtual FGeometryShaderRHIRef RHICreateGeometryShader (TArrayView< const uint8 > Code, const FSHAHash &Hash) final override
 
virtual FComputeShaderRHIRef RHICreateComputeShader (TArrayView< const uint8 > Code, const FSHAHash &Hash) final override
 
virtual FBoundShaderStateRHIRef RHICreateBoundShaderState (FRHIVertexDeclaration *VertexDeclaration, FRHIVertexShader *VertexShader, FRHIPixelShader *PixelShader, FRHIGeometryShader *GeometryShader) final override
 
virtual FGraphicsPipelineStateRHIRef RHICreateGraphicsPipelineState (const FGraphicsPipelineStateInitializer &Initializer) final override
 
virtual TRefCountPtr< FRHIComputePipelineStateRHICreateComputePipelineState (const FComputePipelineStateInitializer &Initializer) final override
 
virtual FUniformBufferRHIRef RHICreateUniformBuffer (const void *Contents, const FRHIUniformBufferLayout *Layout, EUniformBufferUsage Usage, EUniformBufferValidation Validation) final override
 
virtual FRHIBufferInitializer RHICreateBufferInitializer (FRHICommandListBase &RHICmdList, const FRHIBufferCreateDesc &CreateDesc) final override
 
virtual void RHIReplaceResources (FRHICommandListBase &RHICmdList, TArray< FRHIResourceReplaceInfo > &&ReplaceInfos) final override
 
virtual voidRHILockBuffer (class FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer, uint32 Offset, uint32 SizeRHI, EResourceLockMode LockMode) final override
 
virtual void RHIUnlockBuffer (class FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer) final override
 
virtual voidLockBuffer_BottomOfPipe (FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer, uint32 Offset, uint32 SizeRHI, EResourceLockMode LockMode) final override
 
virtual void UnlockBuffer_BottomOfPipe (FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer) final override
 
virtual FShaderResourceViewRHIRef RHICreateShaderResourceView (class FRHICommandListBase &RHICmdList, FRHIViewableResource *Resource, FRHIViewDesc const &ViewDesc) final override
 
virtual FUnorderedAccessViewRHIRef RHICreateUnorderedAccessView (class FRHICommandListBase &RHICmdList, FRHIViewableResource *Resource, FRHIViewDesc const &ViewDesc) final override
 
virtual FRHICalcTextureSizeResult RHICalcTexturePlatformSize (FRHITextureDesc const &Desc, uint32 FirstMipIndex) final override
 
virtual uint64 RHIGetMinimumAlignmentForBufferBackedSRV (EPixelFormat Format) final override
 
virtual void RHIGetTextureMemoryStats (FTextureMemoryStats &OutStats) final override
 
virtual bool RHIGetTextureMemoryVisualizeData (FColor *TextureData, int32 SizeX, int32 SizeY, int32 Pitch, int32 PixelSize) final override
 
virtual FRHITextureInitializer RHICreateTextureInitializer (FRHICommandListBase &RHICmdList, const FRHITextureCreateDesc &CreateDesc) final override
 
virtual FTextureRHIRef RHIAsyncCreateTexture2D (uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ERHIAccess InResourceState, void **InitialMipData, uint32 NumInitialMips, const TCHAR *DebugName, FGraphEventRef &OutCompletionEvent) final override
 
virtual uint32 RHIComputeMemorySize (FRHITexture *TextureRHI) final override
 
virtual FTextureRHIRef RHIAsyncReallocateTexture2D (FRHITexture *Texture2D, int32 NewMipCount, int32 NewSizeX, int32 NewSizeY, FThreadSafeCounter *RequestStatus) final override
 
virtual FRHILockTextureResult RHILockTexture (FRHICommandListImmediate &RHICmdList, const FRHILockTextureArgs &Arguments) final override
 
virtual void RHIUnlockTexture (FRHICommandListImmediate &RHICmdList, const FRHILockTextureArgs &Arguments) final override
 
virtual void RHIUpdateTexture2D (FRHICommandListBase &RHICmdList, FRHITexture *Texture, uint32 MipIndex, const struct FUpdateTextureRegion2D &UpdateRegion, uint32 SourcePitch, const uint8 *SourceData) final override
 
virtual void RHIUpdateTexture3D (FRHICommandListBase &RHICmdList, FRHITexture *Texture, uint32 MipIndex, const struct FUpdateTextureRegion3D &UpdateRegion, uint32 SourceRowPitch, uint32 SourceDepthPitch, const uint8 *SourceData) final override
 
virtual void RHIBindDebugLabelName (FRHICommandListBase &RHICmdList, FRHITexture *Texture, const TCHAR *Name) final override
 
virtual void RHIReadSurfaceData (FRHITexture *Texture, FIntRect Rect, TArray< FColor > &OutData, FReadSurfaceDataFlags InFlags) final override
 
virtual void RHIReadSurfaceData (FRHITexture *TextureRHI, FIntRect InRect, TArray< FLinearColor > &OutData, FReadSurfaceDataFlags InFlags) final override
 
virtual void RHIMapStagingSurface (FRHITexture *Texture, FRHIGPUFence *Fence, void *&OutData, int32 &OutWidth, int32 &OutHeight, uint32 GPUIndex=0) final override
 
virtual void RHIUnmapStagingSurface (FRHITexture *Texture, uint32 GPUIndex=0) final override
 
virtual void RHIReadSurfaceFloatData (FRHITexture *Texture, FIntRect Rect, TArray< FFloat16Color > &OutData, ECubeFace CubeFace, int32 ArrayIndex, int32 MipIndex) final override
 
virtual void RHIRead3DSurfaceFloatData (FRHITexture *Texture, FIntRect Rect, FIntPoint ZMinMax, TArray< FFloat16Color > &OutData) final override
 
virtual FRenderQueryRHIRef RHICreateRenderQuery (ERenderQueryType QueryType) final override
 
virtual bool RHIGetRenderQueryResult (FRHIRenderQuery *RenderQuery, uint64 &OutResult, bool bWait, uint32 GPUIndex=INDEX_NONE) final override
 
virtual FTextureRHIRef RHIGetViewportBackBuffer (FRHIViewport *Viewport) final override
 
virtual void RHIAdvanceFrameForGetViewportBackBuffer (FRHIViewport *Viewport, bool bPresent) final override
 
virtual void RHIFlushResources () final override
 
virtual FViewportRHIRef RHICreateViewport (void *WindowHandle, uint32 SizeX, uint32 SizeY, bool bIsFullscreen, EPixelFormat PreferredPixelFormat) final override
 
virtual void RHIResizeViewport (FRHIViewport *Viewport, uint32 SizeX, uint32 SizeY, bool bIsFullscreen) final override
 
virtual void RHIResizeViewport (FRHIViewport *Viewport, uint32 SizeX, uint32 SizeY, bool bIsFullscreen, EPixelFormat PreferredPixelFormat) final override
 
virtual void RHITick (float DeltaTime) final override
 
virtual void RHIBlockUntilGPUIdle () final override
 
virtual bool RHIGetAvailableResolutions (FScreenResolutionArray &Resolutions, bool bIgnoreRefreshRate) final override
 
virtual void RHIGetSupportedResolution (uint32 &Width, uint32 &Height) final override
 
virtual void *METALRHI_API RHIGetNativeDevice () final override
 
virtual void *METALRHI_API RHIGetNativeGraphicsQueue () final override
 
virtual void *METALRHI_API RHIGetNativeComputeQueue () final override
 
virtual void *METALRHI_API RHIGetNativeInstance () final override
 
virtual class IRHICommandContext *METALRHI_API RHIGetDefaultContext () final override
 
virtual IRHIUploadContextRHIGetUploadContext () final override
 
virtual IRHIComputeContextRHIGetCommandContext (ERHIPipeline Pipeline, FRHIGPUMask GPUMask) final override
 
virtual IRHIComputeContextRHIGetParallelCommandContext (FRHIParallelRenderPassInfo const &ParallelRenderPass, FRHIGPUMask GPUMask) final override
 
virtual void RHIProcessDeleteQueue () final override
 
virtual void RHIFinalizeContext (FRHIFinalizeContextArgs &&Args, TRHIPipelineArray< IRHIPlatformCommandList * > &Output) final override
 
virtual IRHIPlatformCommandListRHIFinalizeParallelContext (IRHIComputeContext *Context) final override
 
virtual void RHISubmitCommandLists (FRHISubmitCommandListsArgs &&Args) final override
 
virtual FTextureRHIRef AsyncReallocateTexture2D_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture2D, int32 NewMipCount, int32 NewSizeX, int32 NewSizeY, FThreadSafeCounter *RequestStatus) final override
 
virtual FUpdateTexture3DData RHIBeginUpdateTexture3D (FRHICommandListBase &RHICmdList, FRHITexture *Texture, uint32 MipIndex, const struct FUpdateTextureRegion3D &UpdateRegion) final override
 
virtual void RHIEndUpdateTexture3D (FRHICommandListBase &RHICmdList, FUpdateTexture3DData &UpdateData) final override
 
virtual void RHICreateTransition (FRHITransition *Transition, const FRHITransitionCreateInfo &CreateInfo) final override
 
virtual void RHIReleaseTransition (FRHITransition *Transition) final override
 
virtual FGPUFenceRHIRef RHICreateGPUFence (const FName &Name) final override
 
virtual void RHIWriteGPUFence_TopOfPipe (FRHICommandListBase &RHICmdList, FRHIGPUFence *FenceRHI) final override
 
virtual FStagingBufferRHIRef RHICreateStagingBuffer () final override
 
virtual voidRHILockStagingBuffer (FRHIStagingBuffer *StagingBuffer, FRHIGPUFence *Fence, uint32 Offset, uint32 SizeRHI) final override
 
virtual void RHIUnlockStagingBuffer (FRHIStagingBuffer *StagingBuffer) final override
 
virtual FRHIShaderLibraryRef RHICreateShaderLibrary_RenderThread (class FRHICommandListImmediate &RHICmdList, EShaderPlatform Platform, FString FilePath, FString Name) final override
 
virtual void RHIUpdateUniformBuffer (FRHICommandListBase &RHICmdList, FRHIUniformBuffer *UniformBufferRHI, const void *Contents) final override
 
virtual uint16 RHIGetPlatformTextureMaxSampleCount () override
 
virtual FTextureReferenceRHIRef RHICreateTextureReference (FRHICommandListBase &RHICmdList, FRHITexture *InReferencedTexture) final override
 
virtual void RHIUpdateTextureReference (FRHICommandListBase &RHICmdList, FRHITextureReference *TextureRef, FRHITexture *NewTexture) final override
 
virtual uint64 RHIComputePrecachePSOHash (const FGraphicsPipelineStateInitializer &Initializer) final override
 
virtual bool RHIMatchPrecachePSOInitializers (const FGraphicsPipelineStateInitializer &LHS, const FGraphicsPipelineStateInitializer &RHS) final override
 
virtual void RHIBeginRenderQuery_TopOfPipe (FRHICommandListBase &RHICmdList, FRHIRenderQuery *RenderQuery) override
 
virtual void RHIEndRenderQuery_TopOfPipe (FRHICommandListBase &RHICmdList, FRHIRenderQuery *RenderQuery) override
 
virtual void RHIBeginRenderQueryBatch_TopOfPipe (FRHICommandListBase &RHICmdList, ERenderQueryType QueryType) final override
 
virtual void RHIEndRenderQueryBatch_TopOfPipe (FRHICommandListBase &RHICmdList, ERenderQueryType QueryType) final override
 
virtual void RHIRunOnQueue (TFunction< void(MTL::CommandQueue *)> &&CodeToRun, bool bWaitForSubmission) final override
 
virtual FTextureRHIRef RHICreateTexture2DFromCVMetalTexture (EPixelFormat Format, ETextureCreateFlags TexCreateFlags, const FClearValueBinding &ClearValueBinding, CVMetalTextureRef Resource) final override
 
template<typename ... Args>
void DeferredDelete (Args &&... InArgs)
 
void SubmitCommands (TConstArrayView< struct FMetalFinalizedCommands * > Commands)
 
void SubmitPayloads (TArray< FMetalPayload * > &&Payloads)
 
void FlushBatchedPayloads (FMetalCommandQueue::FPayloadArray &PayloadsToHandDown)
 
void ProcessInterruptQueueUntil (FGraphEvent *GraphEvent)
 
void ProcessPendingCommandBuffers ()
 
void ProcessInterruptQueueOnGPUCrash ()
 
void InitializeSubmissionPipe ()
 
void ShutdownSubmissionPipe ()
 
void EnqueueEndOfPipeTask (TUniqueFunction< void()> TaskFunc, TUniqueFunction< void(FMetalPayload &)> ModifyPayloadCallback={})
 
FProcessResult ProcessSubmissionQueue ()
 
FProcessResult ProcessInterruptQueue ()
 
void ForEachQueue (TFunctionRef< void(FMetalCommandQueue &)> Callback)
 
- Public Member Functions inherited from IMetalDynamicRHI
virtual ERHIInterfaceType GetInterfaceType () const override final
 
- Public Member Functions inherited from FDynamicRHI
virtual RHI_API ~FDynamicRHI ()
 
virtual void PostInit ()
 
virtual FDynamicRHIGetNonValidationRHI ()
 
void InitPixelFormatInfo (const TArray< uint32 > &PixelFormatBlockBytesIn)
 
virtual FMeshShaderRHIRef RHICreateMeshShader (TArrayView< const uint8 > Code, const FSHAHash &Hash)
 
virtual FAmplificationShaderRHIRef RHICreateAmplificationShader (TArrayView< const uint8 > Code, const FSHAHash &Hash)
 
virtual void FlushPendingLogs ()
 
virtual FWorkGraphShaderRHIRef RHICreateWorkGraphShader (TArrayView< const uint8 > Code, const FSHAHash &Hash, EShaderFrequency ShaderFrequency)
 
virtual IRHITransientResourceAllocatorRHICreateTransientResourceAllocator ()
 
virtual RHI_API voidLockStagingBuffer_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHIStagingBuffer *StagingBuffer, FRHIGPUFence *Fence, uint32 Offset, uint32 SizeRHI)
 
virtual RHI_API void UnlockStagingBuffer_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHIStagingBuffer *StagingBuffer)
 
virtual FWorkGraphPipelineStateRHIRef RHICreateWorkGraphPipelineState (const FWorkGraphPipelineStateInitializer &Initializer)
 
virtual RHI_API voidRHILockBufferMGPU (FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer, uint32 GPUIndex, uint32 Offset, uint32 Size, EResourceLockMode LockMode)
 
virtual RHI_API void RHIUnlockBufferMGPU (FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer, uint32 GPUIndex)
 
virtual FRHIResourceCollectionRef RHICreateResourceCollection (FRHICommandListBase &RHICmdList, TConstArrayView< FRHIResourceCollectionMember > InMembers)
 
virtual void RHIUpdateResourceCollection (FRHICommandListBase &RHICmdList, FRHIResourceCollection *InResourceCollection, uint32 InStartIndex, TConstArrayView< FRHIResourceCollectionMember > InMemberUpdates)
 
virtual void RHIUpdateFromBufferTexture2D (FRHICommandListBase &RHICmdList, FRHITexture *Texture, uint32 MipIndex, const struct FUpdateTextureRegion2D &UpdateRegion, uint32 SourcePitch, FRHIBuffer *Buffer, uint32 BufferOffset)
 
virtual RHI_API void RHIBindDebugLabelName (FRHICommandListBase &RHICmdList, FRHIBuffer *Buffer, const TCHAR *Name)
 
virtual RHI_API void RHIBindDebugLabelName (FRHICommandListBase &RHICmdList, FRHIUnorderedAccessView *UnorderedAccessViewRHI, const TCHAR *Name)
 
virtual RHI_API void RHIReadSurfaceFloatData (FRHITexture *Texture, FIntRect Rect, TArray< FFloat16Color > &OutData, FReadSurfaceDataFlags InFlags)
 
virtual RHI_API void RHIRead3DSurfaceFloatData (FRHITexture *Texture, FIntRect Rect, FIntPoint ZMinMax, TArray< FFloat16Color > &OutData, FReadSurfaceDataFlags InFlags)
 
virtual uint32 RHIGetViewportNextPresentGPUIndex (FRHIViewport *Viewport)
 
virtual FUnorderedAccessViewRHIRef RHIGetViewportBackBufferUAV (FRHIViewport *ViewportRHI)
 
virtual uint32 RHIGetHTilePlatformConfig (uint32 DepthWidth, uint32 DepthHeight) const
 
virtual uint32 RHIGetHTilePlatformConfig (const FRHITextureDesc &DepthDesc) const
 
virtual void RHIAliasTextureResources (FTextureRHIRef &DestTexture, FTextureRHIRef &SrcTexture)
 
virtual FTextureRHIRef RHICreateAliasedTexture (FTextureRHIRef &SourceTexture)
 
virtual void RHIGetDisplaysInformation (FDisplayInformationArray &OutDisplayInformation)
 
virtual RHI_API uint64 RHIComputeStatePrecachePSOHash (const FGraphicsPipelineStateInitializer &Initializer)
 
virtual void RHIAcquireThreadOwnership ()
 
virtual void RHIReleaseThreadOwnership ()
 
virtual EPixelFormat RHIPreferredPixelFormatHint (EPixelFormat PreferredPixelFormat)
 
virtual RHI_API void RHICheckViewportHDRStatus (FRHIViewport *Viewport)
 
virtual void RHIHandleDisplayChange ()
 
virtual void RHIBeginSuspendRendering ()
 
virtual void RHISuspendRendering ()
 
virtual void RHIResumeRendering ()
 
virtual bool RHIIsRenderingSuspended ()
 
virtual RHI_API void RHIVirtualTextureSetFirstMipInMemory (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture, uint32 FirstMip)
 
virtual RHI_API void RHIVirtualTextureSetFirstMipVisible (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture, uint32 FirstMip)
 
virtual voidRHIGetNativePhysicalDevice ()
 
virtual voidRHIGetNativeCommandBuffer ()
 
void RHICloseTranslateChain (FRHIFinalizeContextArgs &&Args, TRHIPipelineArray< IRHIPlatformCommandList * > &Output, bool bShouldFinalize)
 
virtual RHI_API void RHIEndMultiUpdateTexture3D (FRHICommandListBase &RHICmdList, TArray< FUpdateTexture3DData > &UpdateDataArray)
 
virtual RHI_API void RHIMapStagingSurface_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture, uint32 GPUIndex, FRHIGPUFence *Fence, void *&OutData, int32 &OutWidth, int32 &OutHeight)
 
virtual RHI_API void RHIUnmapStagingSurface_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture, uint32 GPUIndex)
 
virtual RHI_API void RHIReadSurfaceFloatData_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture, FIntRect Rect, TArray< FFloat16Color > &OutData, ECubeFace CubeFace, int32 ArrayIndex, int32 MipIndex)
 
virtual RHI_API void RHIReadSurfaceFloatData_RenderThread (class FRHICommandListImmediate &RHICmdList, FRHITexture *Texture, FIntRect Rect, TArray< FFloat16Color > &OutData, FReadSurfaceDataFlags Flags)
 
virtual FRHIFlipDetails RHIWaitForFlip (double TimeoutInSeconds)
 
virtual void RHISignalFlipEvent ()
 
virtual FRayTracingAccelerationStructureSize RHICalcRayTracingSceneSize (const FRayTracingSceneInitializer &Initializer)
 
virtual FRayTracingAccelerationStructureSize RHICalcRayTracingGeometrySize (const FRayTracingGeometryInitializer &Initializer)
 
virtual FRayTracingClusterOperationSize RHICalcRayTracingClusterOperationSize (const FRayTracingClusterOperationInitializer &Initializer)
 
virtual FRayTracingAccelerationStructureOfflineMetadata RHIGetRayTracingGeometryOfflineMetadata (const FRayTracingGeometryOfflineDataHeader &OfflineDataHeader)
 
virtual FRayTracingGeometryRHIRef RHICreateRayTracingGeometry (FRHICommandListBase &RHICmdList, const FRayTracingGeometryInitializer &Initializer)
 
virtual FRayTracingSceneRHIRef RHICreateRayTracingScene (FRayTracingSceneInitializer Initializer)
 
virtual FRayTracingShaderRHIRef RHICreateRayTracingShader (TArrayView< const uint8 > Code, const FSHAHash &Hash, EShaderFrequency ShaderFrequency)
 
virtual FRayTracingPipelineStateRHIRef RHICreateRayTracingPipelineState (const FRayTracingPipelineStateInitializer &Initializer)
 
virtual FShaderBindingTableRHIRef RHICreateShaderBindingTable (FRHICommandListBase &RHICmdList, const FRayTracingShaderBindingTableInitializer &Initializer)
 
virtual void RHISerializeAccelerationStructure (FRHICommandListImmediate &RHICmdList, FRHIRayTracingScene *Scene, const TCHAR *Path)
 
virtual FShaderBundleRHIRef RHICreateShaderBundle (const FShaderBundleCreateInfo &CreateInfo)
 

Static Public Member Functions

static FMetalDynamicRHIGet ()
 
- Static Public Member Functions inherited from FDynamicRHI
static RHI_API void EnableIdealGPUCaptureOptions (bool bEnable)
 

Public Attributes

FGraphEventRef EopTask
 
FCriticalSection SubmissionCS
 
FCriticalSection InterruptCS
 

Friends

class FMetalThread
 

Additional Inherited Members

- Protected Attributes inherited from FDynamicRHI
TArray< uint32PixelFormatBlockBytes
 

Detailed Description

The interface which is implemented by the dynamically bound RHI.

Member Enumeration Documentation

◆ EQueueStatus

Enumerator
None 
Processed 
Pending 

Constructor & Destructor Documentation

◆ FMetalDynamicRHI()

FMetalDynamicRHI::FMetalDynamicRHI ( ERHIFeatureLevel::Type  RequestedFeatureLevel)

Initialization constructor.

◆ ~FMetalDynamicRHI()

FMetalDynamicRHI::~FMetalDynamicRHI ( )

Destructor

Member Function Documentation

◆ AsyncReallocateTexture2D_RenderThread()

FTextureRHIRef FMetalDynamicRHI::AsyncReallocateTexture2D_RenderThread ( class FRHICommandListImmediate RHICmdList,
FRHITexture Texture2D,
int32  NewMipCount,
int32  NewSizeX,
int32  NewSizeY,
FThreadSafeCounter RequestStatus 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ DeferredDelete()

template<typename ... Args>
void FMetalDynamicRHI::DeferredDelete ( Args &&...  InArgs)
inline

◆ EnqueueEndOfPipeTask()

void FMetalDynamicRHI::EnqueueEndOfPipeTask ( TUniqueFunction< void()>  TaskFunc,
TUniqueFunction< void(FMetalPayload &)>  ModifyPayloadCallback = {} 
)

◆ FlushBatchedPayloads()

void FMetalDynamicRHI::FlushBatchedPayloads ( FMetalCommandQueue::FPayloadArray PayloadsToHandDown)

◆ ForEachQueue()

void FMetalDynamicRHI::ForEachQueue ( TFunctionRef< void(FMetalCommandQueue &)>  Callback)

◆ FRIEND_ENUM_CLASS_FLAGS()

FMetalDynamicRHI::FRIEND_ENUM_CLASS_FLAGS ( EQueueStatus  )

◆ Get()

static FMetalDynamicRHI & FMetalDynamicRHI::Get ( )
inlinestatic

◆ GetName()

virtual const TCHAR * FMetalDynamicRHI::GetName ( )
inlineoverridevirtual

Implements FDynamicRHI.

◆ Init()

void FMetalDynamicRHI::Init ( )
virtual

Initializes the RHI; separate from IDynamicRHIModule::CreateRHI so that GDynamicRHI is set when it is called.

Implements FDynamicRHI.

◆ InitializeSubmissionPipe()

void FMetalDynamicRHI::InitializeSubmissionPipe ( )

◆ LockBuffer_BottomOfPipe()

void * FMetalDynamicRHI::LockBuffer_BottomOfPipe ( FRHICommandListBase RHICmdList,
FRHIBuffer Buffer,
uint32  Offset,
uint32  SizeRHI,
EResourceLockMode  LockMode 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ ProcessInterruptQueue()

FMetalDynamicRHI::FProcessResult FMetalDynamicRHI::ProcessInterruptQueue ( )

◆ ProcessInterruptQueueOnGPUCrash()

void FMetalDynamicRHI::ProcessInterruptQueueOnGPUCrash ( )

◆ ProcessInterruptQueueUntil()

void FMetalDynamicRHI::ProcessInterruptQueueUntil ( FGraphEvent GraphEvent)

◆ ProcessPendingCommandBuffers()

void FMetalDynamicRHI::ProcessPendingCommandBuffers ( )

◆ ProcessSubmissionQueue()

FMetalDynamicRHI::FProcessResult FMetalDynamicRHI::ProcessSubmissionQueue ( )

◆ RHIAdvanceFrameForGetViewportBackBuffer()

void FMetalDynamicRHI::RHIAdvanceFrameForGetViewportBackBuffer ( FRHIViewport Viewport,
bool  bPresent 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIAsyncCreateTexture2D()

FTextureRHIRef FMetalDynamicRHI::RHIAsyncCreateTexture2D ( uint32  SizeX,
uint32  SizeY,
uint8  Format,
uint32  NumMips,
ETextureCreateFlags  Flags,
ERHIAccess  InResourceState,
void **  InitialMipData,
uint32  NumInitialMips,
const TCHAR DebugName,
FGraphEventRef OutCompletionEvent 
)
finaloverridevirtual

Thread-safe function that can be used to create a texture outside of the rendering thread. This function can ONLY be called if GRHISupportsAsyncTextureCreation is true. Cannot create rendertargets with this method.

Parameters
SizeX- width of the texture to create
SizeY- height of the texture to create
Format- EPixelFormat texture format
NumMips- number of mips to generate or 0 for full mip pyramid
Flags- ETextureCreateFlags creation flags
InitialMipData- pointers to mip data with which to create the texture
NumInitialMips- how many mips are provided in InitialMipData
OutCompletionEvent- An event signaled on operation completion. Can return null. Operation can still be pending after function returns (e.g. initial data upload in-flight)
Returns
a reference to a 2D texture resource

Implements FDynamicRHI.

◆ RHIAsyncReallocateTexture2D()

FTextureRHIRef FMetalDynamicRHI::RHIAsyncReallocateTexture2D ( FRHITexture Texture2D,
int32  NewMipCount,
int32  NewSizeX,
int32  NewSizeY,
FThreadSafeCounter RequestStatus 
)
finaloverridevirtual

Starts an asynchronous texture reallocation. It may complete immediately if the reallocation could be performed without any reshuffling of texture memory, or if there isn't enough memory. The specified status counter will be decremented by 1 when the reallocation is complete (success or failure).

Returns a new reference to the texture, which will represent the new mip count when the reallocation is complete. RHIFinalizeAsyncReallocateTexture2D() must be called to complete the reallocation.

Parameters
Texture2D- Texture to reallocate
NewMipCount- New number of mip-levels
NewSizeX- New width, in pixels
NewSizeY- New height, in pixels
RequestStatus- Will be decremented by 1 when the reallocation is complete (success or failure).
Returns
- New reference to the texture, or an invalid reference upon failure

Implements FDynamicRHI.

◆ RHIBeginRenderQuery_TopOfPipe()

void FMetalDynamicRHI::RHIBeginRenderQuery_TopOfPipe ( FRHICommandListBase RHICmdList,
FRHIRenderQuery RenderQuery 
)
overridevirtual

Reimplemented from FDynamicRHI.

◆ RHIBeginRenderQueryBatch_TopOfPipe()

void FMetalDynamicRHI::RHIBeginRenderQueryBatch_TopOfPipe ( FRHICommandListBase RHICmdList,
ERenderQueryType  QueryType 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIBeginUpdateTexture3D()

FUpdateTexture3DData FMetalDynamicRHI::RHIBeginUpdateTexture3D ( FRHICommandListBase RHICmdList,
FRHITexture Texture,
uint32  MipIndex,
const struct FUpdateTextureRegion3D UpdateRegion 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIBindDebugLabelName()

void FMetalDynamicRHI::RHIBindDebugLabelName ( FRHICommandListBase RHICmdList,
FRHITexture Texture,
const TCHAR Name 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIBlockUntilGPUIdle()

void FMetalDynamicRHI::RHIBlockUntilGPUIdle ( )
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICalcTexturePlatformSize()

FDynamicRHI::FRHICalcTextureSizeResult FMetalDynamicRHI::RHICalcTexturePlatformSize ( FRHITextureDesc const &  Desc,
uint32  FirstMipIndex 
)
finaloverridevirtual

Computes the total GPU memory a texture resource with the specified parameters will occupy on the current RHI platform. Also returns the required alignment for the resource.

Parameters
Desc- The texture descriptor (width, height, format etc)
FirstMipIndex- The index of the most detailed mip to consider in the memory size calculation.
Returns
- The computed size and alignment of the platform texture resource.

Implements FDynamicRHI.

◆ RHIComputeMemorySize()

uint32 FMetalDynamicRHI::RHIComputeMemorySize ( FRHITexture TextureRHI)
finaloverridevirtual

Computes the size in memory required by a given texture.

Parameters
TextureRHI- Texture we want to know the size of, 0 is safely ignored
Returns
- Size in Bytes

Implements FDynamicRHI.

◆ RHIComputePrecachePSOHash()

uint64 FMetalDynamicRHI::RHIComputePrecachePSOHash ( const FGraphicsPipelineStateInitializer Initializer)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHICreateBlendState()

FBlendStateRHIRef FMetalDynamicRHI::RHICreateBlendState ( const FBlendStateInitializerRHI Initializer)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateBoundShaderState()

FBoundShaderStateRHIRef FMetalDynamicRHI::RHICreateBoundShaderState ( FRHIVertexDeclaration VertexDeclaration,
FRHIVertexShader VertexShader,
FRHIPixelShader PixelShader,
FRHIGeometryShader GeometryShader 
)
finaloverridevirtual

Creates a bound shader state instance which encapsulates a decl, vertex shader and pixel shader CAUTION: Even though this is marked as threadsafe, it is only valid to call from the render thread or the RHI thread. It need not be threadsafe unless the RHI support parallel translation. CAUTION: Platforms that support RHIThread but don't actually have a threadsafe implementation must flush internally with FScopedRHIThreadStaller StallRHIThread(FRHICommandListExecutor::GetImmediateCommandList()); when the call is from the render thread

Parameters
VertexDeclaration- existing vertex decl
VertexShader- existing vertex shader
GeometryShader- existing geometry shader
PixelShader- existing pixel shader

Implements FDynamicRHI.

◆ RHICreateBufferInitializer()

FRHIBufferInitializer FMetalDynamicRHI::RHICreateBufferInitializer ( FRHICommandListBase RHICmdList,
const FRHIBufferCreateDesc CreateDesc 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateComputePipelineState()

TRefCountPtr< FRHIComputePipelineState > FMetalDynamicRHI::RHICreateComputePipelineState ( const FComputePipelineStateInitializer Initializer)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateComputeShader()

FComputeShaderRHIRef FMetalDynamicRHI::RHICreateComputeShader ( TArrayView< const uint8 Code,
const FSHAHash Hash 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateDepthStencilState()

FDepthStencilStateRHIRef FMetalDynamicRHI::RHICreateDepthStencilState ( const FDepthStencilStateInitializerRHI Initializer)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateGeometryShader()

FGeometryShaderRHIRef FMetalDynamicRHI::RHICreateGeometryShader ( TArrayView< const uint8 Code,
const FSHAHash Hash 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateGPUFence()

FGPUFenceRHIRef FMetalDynamicRHI::RHICreateGPUFence ( const FName Name)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateGraphicsPipelineState()

FGraphicsPipelineStateRHIRef FMetalDynamicRHI::RHICreateGraphicsPipelineState ( const FGraphicsPipelineStateInitializer Initializer)
finaloverridevirtual

Creates a graphics pipeline state object (PSO) that represents a complete gpu pipeline for rendering. This function should be considered expensive to call at runtime and may cause hitches as pipelines are compiled.

Parameters
Initializer- Descriptor object defining all the information needed to create the PSO, as well as behavior hints to the RHI.
Returns
FGraphicsPipelineStateRHIRef that can be bound for rendering; nullptr if the compilation fails. CAUTION: On certain RHI implementations (eg, ones that do not support runtime compilation) a compilation failure is a Fatal error and this function will not return. CAUTION: Even though this is marked as threadsafe, it is only valid to call from the render thread or the RHI thread. It need not be threadsafe unless the RHI support parallel translation. CAUTION: Platforms that support RHIThread but don't actually have a threadsafe implementation must flush internally with FScopedRHIThreadStaller StallRHIThread(FRHICommandListExecutor::GetImmediateCommandList()); when the call is from the render thread

Implements FDynamicRHI.

◆ RHICreatePixelShader()

FPixelShaderRHIRef FMetalDynamicRHI::RHICreatePixelShader ( TArrayView< const uint8 Code,
const FSHAHash Hash 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateRasterizerState()

FRasterizerStateRHIRef FMetalDynamicRHI::RHICreateRasterizerState ( const FRasterizerStateInitializerRHI Initializer)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateRenderQuery()

FRenderQueryRHIRef FMetalDynamicRHI::RHICreateRenderQuery ( ERenderQueryType  QueryType)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateSamplerState()

FSamplerStateRHIRef FMetalDynamicRHI::RHICreateSamplerState ( const FSamplerStateInitializerRHI Initializer)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateShaderLibrary()

FRHIShaderLibraryRef FMetalDynamicRHI::RHICreateShaderLibrary ( EShaderPlatform  Platform,
FString const &  FilePath,
FString const &  Name 
)
finaloverridevirtual

Attempts to open a shader library for the given shader platform & name within the provided directory.

Parameters
PlatformThe shader platform for shaders withing the library.
FilePathThe directory in which the library should exist.
NameThe name of the library, i.e. "Global" or "Unreal" without shader-platform or file-extension qualification.
Returns
The new library if one exists and can be constructed, otherwise nil.

Reimplemented from FDynamicRHI.

◆ RHICreateShaderLibrary_RenderThread()

FRHIShaderLibraryRef FMetalDynamicRHI::RHICreateShaderLibrary_RenderThread ( class FRHICommandListImmediate RHICmdList,
EShaderPlatform  Platform,
FString  FilePath,
FString  Name 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHICreateShaderResourceView()

FShaderResourceViewRHIRef FMetalDynamicRHI::RHICreateShaderResourceView ( class FRHICommandListBase RHICmdList,
FRHIViewableResource Resource,
FRHIViewDesc const &  ViewDesc 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateStagingBuffer()

FStagingBufferRHIRef FMetalDynamicRHI::RHICreateStagingBuffer ( )
finaloverridevirtual

Creates a staging buffer, which is memory visible to the cpu without any locking.

Returns
The new staging-buffer.

Reimplemented from FDynamicRHI.

◆ RHICreateTexture2DFromCVMetalTexture()

FTextureRHIRef FMetalDynamicRHI::RHICreateTexture2DFromCVMetalTexture ( EPixelFormat  Format,
ETextureCreateFlags  TexCreateFlags,
const FClearValueBinding ClearValueBinding,
CVMetalTextureRef  Resource 
)
finaloverridevirtual

Implements IMetalDynamicRHI.

◆ RHICreateTextureInitializer()

FRHITextureInitializer FMetalDynamicRHI::RHICreateTextureInitializer ( FRHICommandListBase RHICmdList,
const FRHITextureCreateDesc CreateDesc 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateTextureReference()

FTextureReferenceRHIRef FMetalDynamicRHI::RHICreateTextureReference ( FRHICommandListBase RHICmdList,
FRHITexture InReferencedTexture 
)
finaloverridevirtual

Create a texture reference. InReferencedTexture can be null.

Reimplemented from FDynamicRHI.

◆ RHICreateTransition()

void FMetalDynamicRHI::RHICreateTransition ( FRHITransition Transition,
const FRHITransitionCreateInfo CreateInfo 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHICreateUniformBuffer()

FUniformBufferRHIRef FMetalDynamicRHI::RHICreateUniformBuffer ( const void Contents,
const FRHIUniformBufferLayout Layout,
EUniformBufferUsage  Usage,
EUniformBufferValidation  Validation 
)
finaloverridevirtual

Creates a uniform buffer. The contents of the uniform buffer are provided in a parameter, and are immutable. CAUTION: Even though this is marked as threadsafe, it is only valid to call from the render thread or the RHI thread. Thus is need not be threadsafe on platforms that do not support or aren't using an RHIThread

Parameters
Contents- A pointer to a memory block of size NumBytes that is copied into the new uniform buffer.
NumBytes- The number of bytes the uniform buffer should contain.
Returns
The new uniform buffer.

Implements FDynamicRHI.

◆ RHICreateUnorderedAccessView()

FUnorderedAccessViewRHIRef FMetalDynamicRHI::RHICreateUnorderedAccessView ( class FRHICommandListBase RHICmdList,
FRHIViewableResource Resource,
FRHIViewDesc const &  ViewDesc 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateVertexDeclaration()

FVertexDeclarationRHIRef FMetalDynamicRHI::RHICreateVertexDeclaration ( const FVertexDeclarationElementList Elements)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateVertexShader()

FVertexShaderRHIRef FMetalDynamicRHI::RHICreateVertexShader ( TArrayView< const uint8 Code,
const FSHAHash Hash 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHICreateViewport()

FViewportRHIRef FMetalDynamicRHI::RHICreateViewport ( void WindowHandle,
uint32  SizeX,
uint32  SizeY,
bool  bIsFullscreen,
EPixelFormat  PreferredPixelFormat 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIEndFrame()

void FMetalDynamicRHI::RHIEndFrame ( const FRHIEndFrameArgs Args)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIEndFrame_RenderThread()

void FMetalDynamicRHI::RHIEndFrame_RenderThread ( FRHICommandListImmediate RHICmdList)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIEndRenderQuery_TopOfPipe()

void FMetalDynamicRHI::RHIEndRenderQuery_TopOfPipe ( FRHICommandListBase RHICmdList,
FRHIRenderQuery RenderQuery 
)
overridevirtual

Reimplemented from FDynamicRHI.

◆ RHIEndRenderQueryBatch_TopOfPipe()

void FMetalDynamicRHI::RHIEndRenderQueryBatch_TopOfPipe ( FRHICommandListBase RHICmdList,
ERenderQueryType  QueryType 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIEndUpdateTexture3D()

void FMetalDynamicRHI::RHIEndUpdateTexture3D ( FRHICommandListBase RHICmdList,
FUpdateTexture3DData UpdateData 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIFinalizeContext()

void FMetalDynamicRHI::RHIFinalizeContext ( FRHIFinalizeContextArgs &&  Args,
TRHIPipelineArray< IRHIPlatformCommandList * > &  Output 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIFinalizeParallelContext()

IRHIPlatformCommandList * FMetalDynamicRHI::RHIFinalizeParallelContext ( IRHIComputeContext Context)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIFlushResources()

void FMetalDynamicRHI::RHIFlushResources ( )
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIGetAvailableResolutions()

bool FMetalDynamicRHI::RHIGetAvailableResolutions ( FScreenResolutionArray Resolutions,
bool  bIgnoreRefreshRate 
)
finaloverridevirtual

Retrieve available screen resolutions.

Parameters
ResolutionsTArray<FScreenResolutionRHI> parameter that will be filled in.
bIgnoreRefreshRateIf true, ignore refresh rates.
Returns
bool true if successfully filled the array

Implements FDynamicRHI.

◆ RHIGetCommandContext()

IRHIComputeContext * FMetalDynamicRHI::RHIGetCommandContext ( ERHIPipeline  Pipeline,
FRHIGPUMask  GPUMask 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIGetDefaultContext()

IRHICommandContext * FMetalDynamicRHI::RHIGetDefaultContext ( )
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIGetMinimumAlignmentForBufferBackedSRV()

uint64 FMetalDynamicRHI::RHIGetMinimumAlignmentForBufferBackedSRV ( EPixelFormat  Format)
finaloverridevirtual

Gets the minimum alignment (in bytes) required for creating a shader resource view on a buffer-backed resource.

Parameters
Format- EPixelFormat texture format of the SRV.

Reimplemented from FDynamicRHI.

◆ RHIGetNativeComputeQueue()

void * FMetalDynamicRHI::RHIGetNativeComputeQueue ( )
finaloverridevirtual

Provides access to the native compute command queue. Generally this should be avoided but is useful for third party plugins.

Reimplemented from FDynamicRHI.

◆ RHIGetNativeDevice()

void * FMetalDynamicRHI::RHIGetNativeDevice ( )
finaloverridevirtual

Provides access to the native device. Generally this should be avoided but is useful for third party plugins.

Implements FDynamicRHI.

◆ RHIGetNativeGraphicsQueue()

void * FMetalDynamicRHI::RHIGetNativeGraphicsQueue ( )
finaloverridevirtual

Provides access to the native graphics command queue. Generally this should be avoided but is useful for third party plugins.

Reimplemented from FDynamicRHI.

◆ RHIGetNativeInstance()

void * FMetalDynamicRHI::RHIGetNativeInstance ( )
finaloverridevirtual

Provides access to the native instance. Generally this should be avoided but is useful for third party plugins.

Implements FDynamicRHI.

◆ RHIGetParallelCommandContext()

IRHIComputeContext * FMetalDynamicRHI::RHIGetParallelCommandContext ( FRHIParallelRenderPassInfo const &  ParallelRenderPass,
FRHIGPUMask  GPUMask 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIGetPlatformTextureMaxSampleCount()

uint16 FMetalDynamicRHI::RHIGetPlatformTextureMaxSampleCount ( )
overridevirtual

Reimplemented from FDynamicRHI.

◆ RHIGetRenderQueryResult()

bool FMetalDynamicRHI::RHIGetRenderQueryResult ( FRHIRenderQuery RenderQuery,
uint64 OutResult,
bool  bWait,
uint32  GPUIndex = INDEX_NONE 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIGetSupportedResolution()

void FMetalDynamicRHI::RHIGetSupportedResolution ( uint32 Width,
uint32 Height 
)
finaloverridevirtual

Returns a supported screen resolution that most closely matches input.

Parameters
Width- Input: Desired resolution width in pixels. Output: A width that the platform supports.
Height- Input: Desired resolution height in pixels. Output: A height that the platform supports.

Implements FDynamicRHI.

◆ RHIGetTextureMemoryStats()

void FMetalDynamicRHI::RHIGetTextureMemoryStats ( FTextureMemoryStats OutStats)
finaloverridevirtual

Retrieves texture memory stats. safe to call on the main thread

Implements FDynamicRHI.

◆ RHIGetTextureMemoryVisualizeData()

bool FMetalDynamicRHI::RHIGetTextureMemoryVisualizeData ( FColor TextureData,
int32  SizeX,
int32  SizeY,
int32  Pitch,
int32  PixelSize 
)
finaloverridevirtual

Fills a texture with to visualize the texture pool memory.

Parameters
TextureDataStart address
SizeXNumber of pixels along X
SizeYNumber of pixels along Y
PitchNumber of bytes between each row
PixelSizeNumber of bytes each pixel represents
Returns
true if successful, false otherwise

Implements FDynamicRHI.

◆ RHIGetUploadContext()

IRHIUploadContext * FMetalDynamicRHI::RHIGetUploadContext ( )
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIGetViewportBackBuffer()

FTextureRHIRef FMetalDynamicRHI::RHIGetViewportBackBuffer ( FRHIViewport Viewport)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHILockBuffer()

void * FMetalDynamicRHI::RHILockBuffer ( class FRHICommandListBase RHICmdList,
FRHIBuffer Buffer,
uint32  Offset,
uint32  SizeRHI,
EResourceLockMode  LockMode 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHILockStagingBuffer()

void * FMetalDynamicRHI::RHILockStagingBuffer ( FRHIStagingBuffer StagingBuffer,
FRHIGPUFence Fence,
uint32  Offset,
uint32  SizeRHI 
)
finaloverridevirtual

Lock a staging buffer to read contents on the CPU that were written by the GPU, without having to stall. @discussion This function requires that you have issued an CopyToStagingBuffer invocation and verified that the FRHIGPUFence has been signaled before calling.

Parameters
StagingBufferThe buffer to lock.
FenceAn optional fence synchronized with the last buffer update.
OffsetThe offset in the buffer to return.
SizeRHIThe length of the region in the buffer to lock.
Returns
A pointer to the data starting at 'Offset' and of length 'SizeRHI' from 'StagingBuffer', or nullptr when there is an error.

Reimplemented from FDynamicRHI.

◆ RHILockTexture()

FRHILockTextureResult FMetalDynamicRHI::RHILockTexture ( FRHICommandListImmediate RHICmdList,
const FRHILockTextureArgs Arguments 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIMapStagingSurface()

void FMetalDynamicRHI::RHIMapStagingSurface ( FRHITexture Texture,
FRHIGPUFence Fence,
void *&  OutData,
int32 OutWidth,
int32 OutHeight,
uint32  GPUIndex = 0 
)
finaloverridevirtual

Implemented by the platform to read directly from the texture. Useful for getting the last back buffer content after a crash. As the RHIReadSurfaceData implementation will copy the texture's content to a new temporary buffer, that won't work for an unknown crash state. Watch out for OutData to be 0 (can happen on DXGI_ERROR_DEVICE_REMOVED), don't call RHIUnmapStagingSurface in that case.

Implements FDynamicRHI.

◆ RHIMatchPrecachePSOInitializers()

bool FMetalDynamicRHI::RHIMatchPrecachePSOInitializers ( const FGraphicsPipelineStateInitializer LHS,
const FGraphicsPipelineStateInitializer RHS 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIProcessDeleteQueue()

void FMetalDynamicRHI::RHIProcessDeleteQueue ( )
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIRead3DSurfaceFloatData()

void FMetalDynamicRHI::RHIRead3DSurfaceFloatData ( FRHITexture Texture,
FIntRect  Rect,
FIntPoint  ZMinMax,
TArray< FFloat16Color > &  OutData 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIReadSurfaceData() [1/2]

void FMetalDynamicRHI::RHIReadSurfaceData ( FRHITexture Texture,
FIntRect  Rect,
TArray< FColor > &  OutData,
FReadSurfaceDataFlags  InFlags 
)
finaloverridevirtual

Reads the contents of a texture to an output buffer (non MSAA and MSAA) and returns it as a FColor array. If the format or texture type is unsupported the OutData array will be size 0

Implements FDynamicRHI.

◆ RHIReadSurfaceData() [2/2]

void FMetalDynamicRHI::RHIReadSurfaceData ( FRHITexture TextureRHI,
FIntRect  InRect,
TArray< FLinearColor > &  OutData,
FReadSurfaceDataFlags  InFlags 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIReadSurfaceFloatData()

void FMetalDynamicRHI::RHIReadSurfaceFloatData ( FRHITexture Texture,
FIntRect  Rect,
TArray< FFloat16Color > &  OutData,
ECubeFace  CubeFace,
int32  ArrayIndex,
int32  MipIndex 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIReleaseTransition()

void FMetalDynamicRHI::RHIReleaseTransition ( FRHITransition Transition)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIReplaceResources()

void FMetalDynamicRHI::RHIReplaceResources ( FRHICommandListBase RHICmdList,
TArray< FRHIResourceReplaceInfo > &&  ReplaceInfos 
)
finaloverridevirtual

Transfer metadata and underlying resource from src to dest and release any resource owned by dest.

Parameters
DestBuffer- the buffer to update
SrcBuffer- don't use after call. If null, will release any resource owned by DestBuffer

Implements FDynamicRHI.

◆ RHIResizeViewport() [1/2]

void FMetalDynamicRHI::RHIResizeViewport ( FRHIViewport Viewport,
uint32  SizeX,
uint32  SizeY,
bool  bIsFullscreen 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIResizeViewport() [2/2]

void FMetalDynamicRHI::RHIResizeViewport ( FRHIViewport Viewport,
uint32  SizeX,
uint32  SizeY,
bool  bIsFullscreen,
EPixelFormat  PreferredPixelFormat 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIRunOnQueue()

void FMetalDynamicRHI::RHIRunOnQueue ( TFunction< void(MTL::CommandQueue *)> &&  CodeToRun,
bool  bWaitForSubmission 
)
finaloverridevirtual

Implements IMetalDynamicRHI.

◆ RHISubmitCommandLists()

void FMetalDynamicRHI::RHISubmitCommandLists ( FRHISubmitCommandListsArgs &&  Args)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHITick()

void FMetalDynamicRHI::RHITick ( float  DeltaTime)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIUnlockBuffer()

void FMetalDynamicRHI::RHIUnlockBuffer ( class FRHICommandListBase RHICmdList,
FRHIBuffer Buffer 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIUnlockStagingBuffer()

void FMetalDynamicRHI::RHIUnlockStagingBuffer ( FRHIStagingBuffer StagingBuffer)
finaloverridevirtual

Unlock a staging buffer previously locked with RHILockStagingBuffer.

Parameters
StagingBufferThe buffer that was previously locked.

Reimplemented from FDynamicRHI.

◆ RHIUnlockTexture()

void FMetalDynamicRHI::RHIUnlockTexture ( FRHICommandListImmediate RHICmdList,
const FRHILockTextureArgs Arguments 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIUnmapStagingSurface()

void FMetalDynamicRHI::RHIUnmapStagingSurface ( FRHITexture Texture,
uint32  GPUIndex = 0 
)
finaloverridevirtual

call after a succesful RHIMapStagingSurface() call

Implements FDynamicRHI.

◆ RHIUpdateTexture2D()

void FMetalDynamicRHI::RHIUpdateTexture2D ( FRHICommandListBase RHICmdList,
FRHITexture Texture,
uint32  MipIndex,
const struct FUpdateTextureRegion2D UpdateRegion,
uint32  SourcePitch,
const uint8 SourceData 
)
finaloverridevirtual

Updates a region of a 2D texture from system memory

Parameters
Texture- the RHI texture resource to update
MipIndex- mip level index to be modified
UpdateRegion- The rectangle to copy source image data from
SourcePitch- size in bytes of each row of the source image
SourceData- source image data, starting at the upper left corner of the source rectangle (in same pixel format as texture)

Implements FDynamicRHI.

◆ RHIUpdateTexture3D()

void FMetalDynamicRHI::RHIUpdateTexture3D ( FRHICommandListBase RHICmdList,
FRHITexture Texture,
uint32  MipIndex,
const struct FUpdateTextureRegion3D UpdateRegion,
uint32  SourceRowPitch,
uint32  SourceDepthPitch,
const uint8 SourceData 
)
finaloverridevirtual

Updates a region of a 3D texture from system memory

Parameters
Texture- the RHI texture resource to update
MipIndex- mip level index to be modified
UpdateRegion- The rectangle to copy source image data from
SourceRowPitch- size in bytes of each row of the source image, usually Bpp * SizeX
SourceDepthPitch- size in bytes of each depth slice of the source image, usually Bpp * SizeX * SizeY
SourceData- source image data, starting at the upper left corner of the source rectangle (in same pixel format as texture)

Implements FDynamicRHI.

◆ RHIUpdateTextureReference()

void FMetalDynamicRHI::RHIUpdateTextureReference ( FRHICommandListBase RHICmdList,
FRHITextureReference TextureRef,
FRHITexture NewTexture 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ RHIUpdateUniformBuffer()

void FMetalDynamicRHI::RHIUpdateUniformBuffer ( FRHICommandListBase RHICmdList,
FRHIUniformBuffer UniformBufferRHI,
const void Contents 
)
finaloverridevirtual

Implements FDynamicRHI.

◆ RHIWriteGPUFence_TopOfPipe()

void FMetalDynamicRHI::RHIWriteGPUFence_TopOfPipe ( FRHICommandListBase RHICmdList,
FRHIGPUFence FenceRHI 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

◆ Shutdown()

virtual void FMetalDynamicRHI::Shutdown ( )
inlinevirtual

Shutdown the RHI; handle shutdown and resource destruction before the RHI's actual destructor is called (so that all resources of the RHI are still available for shutdown).

Implements FDynamicRHI.

◆ ShutdownSubmissionPipe()

void FMetalDynamicRHI::ShutdownSubmissionPipe ( )

◆ SubmitCommands()

void FMetalDynamicRHI::SubmitCommands ( TConstArrayView< struct FMetalFinalizedCommands * >  Commands)

◆ SubmitPayloads()

void FMetalDynamicRHI::SubmitPayloads ( TArray< FMetalPayload * > &&  Payloads)

◆ UnlockBuffer_BottomOfPipe()

void FMetalDynamicRHI::UnlockBuffer_BottomOfPipe ( FRHICommandListBase RHICmdList,
FRHIBuffer Buffer 
)
finaloverridevirtual

Reimplemented from FDynamicRHI.

Friends And Related Symbol Documentation

◆ FMetalThread

friend class FMetalThread
friend

Member Data Documentation

◆ EopTask

FGraphEventRef FMetalDynamicRHI::EopTask

◆ InterruptCS

FCriticalSection FMetalDynamicRHI::InterruptCS

◆ SubmissionCS

FCriticalSection FMetalDynamicRHI::SubmissionCS

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