UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FShaderCompileThreadRunnableBase Class Referenceabstract

#include <ShaderCompiler.h>

+ Inheritance diagram for FShaderCompileThreadRunnableBase:

Public Member Functions

 FShaderCompileThreadRunnableBase (class FShaderCompilingManager *InManager)
 
virtual ~FShaderCompileThreadRunnableBase ()
 
void SetPriorityRange (EShaderCompileJobPriority MinPriority, EShaderCompileJobPriority MaxPriority)
 
void StartThread ()
 
virtual void Stop ()
 
virtual uint32 Run ()
 
void WaitForCompletion () const
 
virtual int32 CompilingLoop ()=0
 
virtual EShaderCompilerWorkerType GetWorkerType () const =0
 
virtual void OnMachineResourcesChanged ()
 
virtual void ForEachPendingJob (const FShaderCompileJobCallback &PendingJobCallback) const
 
- Public Member Functions inherited from FRunnable
virtual bool Init ()
 
virtual void Exit ()
 
virtual class FSingleThreadRunnableGetSingleThreadInterface ()
 
virtual ~FRunnable ()
 

Protected Member Functions

virtual bool PrintWorkerMemoryUsage (bool bAllowToWaitForLock=true)
 
virtual FShaderCompileMemoryUsage GetExternalWorkerMemoryUsage ()
 
virtual const TCHARGetThreadName () const
 
bool WorkerStateHeartbeat (uint64 InWorkerStateHash)
 

Protected Attributes

class FShaderCompilingManagerManager
 
FRunnableThreadThread
 
int32 MinPriorityIndex
 
int32 MaxPriorityIndex
 
TAtomic< boolbForceFinish
 

Friends

class FShaderCompilingManager
 

Constructor & Destructor Documentation

◆ FShaderCompileThreadRunnableBase()

FShaderCompileThreadRunnableBase::FShaderCompileThreadRunnableBase ( class FShaderCompilingManager InManager)

◆ ~FShaderCompileThreadRunnableBase()

virtual FShaderCompileThreadRunnableBase::~FShaderCompileThreadRunnableBase ( )
inlinevirtual

Member Function Documentation

◆ CompilingLoop()

virtual int32 FShaderCompileThreadRunnableBase::CompilingLoop ( )
pure virtual

Main work loop.

Implemented in FShaderCompileDistributedThreadRunnable_Interface.

◆ ForEachPendingJob()

virtual void FShaderCompileThreadRunnableBase::ForEachPendingJob ( const FShaderCompileJobCallback PendingJobCallback) const
inlinevirtual

Invokes the specified callback on each pending job this shader compile thread is processing. Use this to find compile jobs that are already sent to a worker, since once a worker processes them, they are no longer in the "pending list" of the shader compile manager (i.e. FShaderCompileJobCollection specifically).

Parameters
PendingJobCallbackFunction callback that is invoked on each pending job. Returns false to exit the iteration early.

Reimplemented in FShaderCompileDistributedThreadRunnable_Interface.

◆ GetExternalWorkerMemoryUsage()

virtual FShaderCompileMemoryUsage FShaderCompileThreadRunnableBase::GetExternalWorkerMemoryUsage ( )
inlineprotectedvirtual

Returns the amount of memory (in bytes) used by external processes related to this, if any.

Reimplemented in FShaderCompileThreadRunnable.

◆ GetThreadName()

virtual const TCHAR * FShaderCompileThreadRunnableBase::GetThreadName ( ) const
inlineprotectedvirtual

◆ GetWorkerType()

virtual EShaderCompilerWorkerType FShaderCompileThreadRunnableBase::GetWorkerType ( ) const
pure virtual

Returns the type of shader workers this thread represents.

Implemented in FShaderCompileThreadRunnable, and FShaderCompileDistributedThreadRunnable_Interface.

◆ OnMachineResourcesChanged()

virtual void FShaderCompileThreadRunnableBase::OnMachineResourcesChanged ( )
inlinevirtual

Events from the manager

◆ PrintWorkerMemoryUsage()

virtual bool FShaderCompileThreadRunnableBase::PrintWorkerMemoryUsage ( bool  bAllowToWaitForLock = true)
inlineprotectedvirtual

Tries to print out the memory usage of all shader compile workers. When called during an out-of-memory event, it is useful to allow this process to wait for any locks, so we can rule out deadlocks while reporting out-of-memory errors. Returns whether the memory usage was successfully printed.

Reimplemented in FShaderCompileThreadRunnable.

◆ Run()

uint32 FShaderCompileThreadRunnableBase::Run ( void  )
virtual

Entry point for the shader compiling thread.

Implements FRunnable.

◆ SetPriorityRange()

void FShaderCompileThreadRunnableBase::SetPriorityRange ( EShaderCompileJobPriority  MinPriority,
EShaderCompileJobPriority  MaxPriority 
)

◆ StartThread()

void FShaderCompileThreadRunnableBase::StartThread ( )

◆ Stop()

virtual void FShaderCompileThreadRunnableBase::Stop ( void  )
inlinevirtual

Stops the runnable object.

This is called if a thread is requested to terminate early.

See also
Init, Run, Exit

Reimplemented from FRunnable.

◆ WaitForCompletion()

void FShaderCompileThreadRunnableBase::WaitForCompletion ( ) const
inline

◆ WorkerStateHeartbeat()

bool FShaderCompileThreadRunnableBase::WorkerStateHeartbeat ( uint64  InWorkerStateHash)
protected

Returns false if the new worker state hash hasn't changed in a certain period of time. If false, a warning is printed. An input hash of 0 will always succeed and effectively reset the timer. A value of 0 should be used when no jobs are pending.

Friends And Related Symbol Documentation

◆ FShaderCompilingManager

Member Data Documentation

◆ bForceFinish

TAtomic<bool> FShaderCompileThreadRunnableBase::bForceFinish
protected

◆ Manager

class FShaderCompilingManager* FShaderCompileThreadRunnableBase::Manager
protected

The manager for this thread

◆ MaxPriorityIndex

int32 FShaderCompileThreadRunnableBase::MaxPriorityIndex
protected

◆ MinPriorityIndex

int32 FShaderCompileThreadRunnableBase::MinPriorityIndex
protected

◆ Thread

FRunnableThread* FShaderCompileThreadRunnableBase::Thread
protected

The runnable thread


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