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.
| 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.
| 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.
| 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.
|
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.
|
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.
| 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. |
|
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.