engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 友元 | 所有成员列表
FShaderCompilingManager类 参考

Manager of asynchronous and parallel shader compilation. 更多...

#include <ShaderCompiler.h>

Public 成员函数

ENGINE_API void AddJobs (TArray< TSharedRef< FShaderCommonCompileJob, ESPMode::ThreadSafe > > &NewJobs, bool bOptimizeForLowLatency, bool bRecreateComponentRenderStateOnCompletion, const FString MaterialBasePath, FString PermutationString=FString(""), bool bSkipResultProcessing=false)
 Adds shader jobs to be asynchronously compiled. 更多...
 
ENGINE_API void CancelCompilation (const TCHAR *MaterialName, const TArray< int32 > &ShaderMapIdsToCancel)
 Removes all outstanding compile jobs for the passed shader maps.
 
ENGINE_API void FinishAllCompilation ()
 Blocks until completion of all async shader compiling, and assigns shader maps to relevant materials. 更多...
 
ENGINE_API void FinishCompilation (const TCHAR *MaterialName, const TArray< int32 > &ShaderMapIdsToFinishCompiling)
 Blocks until completion of the requested shader maps. 更多...
 
int32 GetNumRemainingJobs () const
 Returns the number of outstanding compile jobs. 更多...
 
bool HasShaderJobs () const
 return true if we have shader jobs in any state shader jobs are removed when they are applied to the gamethreadshadermap accessable from gamethread
 
bool IsCompiling () const
 Returns whether async compiling is happening. 更多...
 
ENGINE_API void ProcessAsyncResults (bool bLimitExecutionTime, bool bBlockOnGlobalShaderCompletion)
 Processes completed asynchronous shader maps, and assigns them to relevant materials. 更多...
 
bool ShouldDisplayCompilingNotification () const
 Returns whether to display a notification that shader compiling is happening in the background. 更多...
 
ENGINE_API void Shutdown ()
 Shutdown the shader compiler manager, this will shutdown immediately and not process any more shader compile requests.
 

静态 Public 成员函数

static bool IsShaderCompilerWorkerRunning (FProcHandle &WorkerHandle)
 Returns true if the given shader compile worker is still running.
 

友元

class FShaderCompileThreadRunnable
 

详细描述

Manager of asynchronous and parallel shader compilation.

This class contains an interface to enqueue and retreive asynchronous shader jobs, and manages a FShaderCompileThreadRunnable.

成员函数说明

◆ AddJobs()

ENGINE_API void FShaderCompilingManager::AddJobs ( TArray< TSharedRef< FShaderCommonCompileJob, ESPMode::ThreadSafe > > &  NewJobs,
bool  bOptimizeForLowLatency,
bool  bRecreateComponentRenderStateOnCompletion,
const FString  MaterialBasePath,
FString  PermutationString = FString(""),
bool  bSkipResultProcessing = false 
)

Adds shader jobs to be asynchronously compiled.

FinishCompilation or ProcessAsyncResults must be used to get the results.

◆ FinishAllCompilation()

ENGINE_API void FShaderCompilingManager::FinishAllCompilation ( )

Blocks until completion of all async shader compiling, and assigns shader maps to relevant materials.

This should be called before exit if the DDC needs to be made up to date.

◆ FinishCompilation()

ENGINE_API void FShaderCompilingManager::FinishCompilation ( const TCHAR *  MaterialName,
const TArray< int32 > &  ShaderMapIdsToFinishCompiling 
)

Blocks until completion of the requested shader maps.


This will not assign the shader map to any materials, the caller is responsible for that.

◆ GetNumRemainingJobs()

int32 FShaderCompilingManager::GetNumRemainingJobs ( ) const
inline

Returns the number of outstanding compile jobs.

Note: This is dependent on NumOutstandingJobs which is updated from another thread, so the results are non-deterministic.

◆ IsCompiling()

bool FShaderCompilingManager::IsCompiling ( ) const
inline

Returns whether async compiling is happening.

Note: This is dependent on NumOutstandingJobs which is updated from another thread, so the results are non-deterministic.

◆ ProcessAsyncResults()

ENGINE_API void FShaderCompilingManager::ProcessAsyncResults ( bool  bLimitExecutionTime,
bool  bBlockOnGlobalShaderCompletion 
)

Processes completed asynchronous shader maps, and assigns them to relevant materials.

参数
bLimitExecutionTime- When enabled, ProcessAsyncResults will be bandwidth throttled by ProcessGameThreadTargetTime, to limit hitching. ProcessAsyncResults will then have to be called often to finish all shader maps (eg from Tick). Otherwise, all compiled shader maps will be processed.
bBlockOnGlobalShaderCompletion- When enabled, ProcessAsyncResults will block until global shader maps are complete. This must be done before using global shaders for rendering.

◆ ShouldDisplayCompilingNotification()

bool FShaderCompilingManager::ShouldDisplayCompilingNotification ( ) const
inline

Returns whether to display a notification that shader compiling is happening in the background.

Note: This is dependent on NumOutstandingJobs which is updated from another thread, so the results are non-deterministic.


该类的文档由以下文件生成: