FShaderPipelineCache: The FShaderPipelineCache provides the new Pipeline State Object (PSO) logging, serialisation & precompilation mechanism that replaces FShaderCache. 更多...
#include <ShaderPipelineCache.h>
类 FShaderPipelineCache 继承关系图:类 | |
| class | FShaderCachePrecompileContext |
| Allows handlers of FShaderCacheOpenedDelegate to send state to begin and complete pre-compilation delegates 更多... | |
Public 成员函数 | |
| DECLARE_MULTICAST_DELEGATE_FiveParams (FShaderCacheOpenedDelegate, FString const &, EShaderPlatform, uint32, const FGuid &, FShaderCachePrecompileContext &) | |
| Delegate signature for being notified when a pipeline cache is opened | |
| DECLARE_MULTICAST_DELEGATE_ThreeParams (FShaderCachePreOpenDelegate, FString const &, EShaderPlatform, bool &) | |
| Delegate signature for being notified when we are about to open the pipeline cache | |
| DECLARE_MULTICAST_DELEGATE_ThreeParams (FShaderPrecompilationCompleteDelegate, uint32, double, const FShaderCachePrecompileContext &) | |
| Delegate signature for being notified that all currently viable PSOs have been precompiled from the cache, how many that was and how long spent precompiling (in sec.) | |
| DECLARE_MULTICAST_DELEGATE_TwoParams (FShaderCacheClosedDelegate, FString const &, EShaderPlatform) | |
| Delegate signature for being notified when a pipeline cache is closed | |
| DECLARE_MULTICAST_DELEGATE_TwoParams (FShaderPrecompilationBeginDelegate, uint32, const FShaderCachePrecompileContext &) | |
| Delegate signature for being notified when currently viable PSOs have started to be precompiled from the cache, and how many will be precompiled | |
| TStatId | GetStatId () const |
| return the stat id to use for this tickable | |
| bool | IsTickable () const |
| Pure virtual that must be overloaded by the inheriting class. 更多... | |
| bool | NeedsRenderingResumedForRenderingThreadTick () const |
| Used to determine if a rendering thread tickable object must have rendering in a non-suspended state during it's Tick function. 更多... | |
| void | Tick (float DeltaTime) |
| Pure virtual that must be overloaded by the inheriting class. 更多... | |
Public 成员函数 继承自 FTickableObjectRenderThread | |
| FTickableObjectRenderThread (bool bRegisterImmediately=true, bool bInHighFrequency=false) | |
| Registers this instance with the static array of tickable objects. 更多... | |
| virtual TStatId | GetStatId () const =0 |
| return the stat id to use for this tickable | |
| virtual bool | IsTickable () const =0 |
| Pure virtual that must be overloaded by the inheriting class. 更多... | |
| virtual bool | NeedsRenderingResumedForRenderingThreadTick () const |
| Used to determine if a rendering thread tickable object must have rendering in a non-suspended state during it's Tick function. 更多... | |
| void | Register (bool bIsRenderingThreadObject=false) |
| Registers the object for ticking. 更多... | |
| virtual void | Tick (float DeltaTime)=0 |
| Pure virtual that must be overloaded by the inheriting class. 更多... | |
| virtual | ~FTickableObjectRenderThread () |
| Removes this instance from the static array of tickable objects. | |
静态 Public 成员函数 | |
| static void | ClosePipelineFileCache () |
| Closes the existing pipeline cache, allowing it to be reopened with a different file and/or shader platform. 更多... | |
| static FShaderCacheClosedDelegate & | GetCacheClosedDelegate () |
| Gets the event delegate to register to to be notified when a pipeline cache is closed. | |
| static FShaderCacheOpenedDelegate & | GetCacheOpenedDelegate () |
| Gets the event delegate to register to to be notified when a pipeline cache is opened. | |
| static FShaderCachePreOpenDelegate & | GetCachePreOpenDelegate () |
| Gets the event delegate to register to to be notified when we are about to open the pipeline cache. | |
| static FShaderPrecompilationBeginDelegate & | GetPrecompilationBeginDelegate () |
| Gets the event delegate to register to to be notified when currently viable PSOs have started to be precompiled from the cache. | |
| static FShaderPrecompilationCompleteDelegate & | GetPrecompilationCompleteDelegate () |
| Gets the event delegate to register to to be notified when all currently viable PSOs have been precompiled from the cache. | |
| static void | Initialize (EShaderPlatform Platform) |
| Initializes the shader pipeline cache for the desired platform, called by the engine. 更多... | |
| static uint32 | NumPrecompilesActive () |
| Returns the number of pipelines actively being precompiled this frame. | |
| static uint32 | NumPrecompilesRemaining () |
| Returns the number of pipelines waiting for precompilation. | |
| static bool | OpenPipelineFileCache (EShaderPlatform Platform) |
| Opens the shader pipeline cache file with either the LastOpened setting if available, or the project name otherwise | |
| static bool | OpenPipelineFileCache (FString const &Name, EShaderPlatform Platform) |
| Opens the shader pipeline cache file with the given name and shader platform. | |
| static void | PauseBatching () |
| Pauses precompilation. | |
| static void | ResumeBatching () |
| Resumes precompilation batching. | |
| static bool | SavePipelineFileCache (FPipelineFileCache::SaveMode Mode) |
| Saves the current shader pipeline cache to disk using one of the defined save modes, Fast uses an incremental approach whereas Slow will consolidate all data into the file. | |
| static void | SetBatchMode (BatchMode Mode) |
| Sets the precompilation batching mode. | |
| static bool | SetGameUsageMaskWithComparison (uint64 Mask, FPSOMaskComparisonFn InComparisonFnPtr) |
| Set the current PSO Game Usage Mask and comparsion function . 更多... | |
| static void | ShaderLibraryStateChanged (ELibraryState State, EShaderPlatform Platform, FString const &Name) |
| Called by FShaderCodeLibrary to notify us that the shader code library state changed and shader availability will need to be re-evaluated | |
| static void | Shutdown () |
| Terminates the shader pipeline cache, called by the engine. | |
FShaderPipelineCache: The FShaderPipelineCache provides the new Pipeline State Object (PSO) logging, serialisation & precompilation mechanism that replaces FShaderCache.
Caching Pipeline State Objects and serialising the initialisers to disk allows for precompilation of these states the next time the game is run, which reduces hitching. To achieve this FShaderPipelineCache relies upon FShaderCodeLibrary & "Share Material Shader Code" and the RHI-level backend FPipelineFileCache.
Basic Runtime Usage:
Other Runtime Options:
Logging Usage:
Notes:
File Locations & Packaging:
Requirements:
|
static |
Closes the existing pipeline cache, allowing it to be reopened with a different file and/or shader platform.
Will implicitly invoke a Fast Save.
|
static |
Initializes the shader pipeline cache for the desired platform, called by the engine.
The shader platform is used only to load the initial pipeline cache and can be changed by closing & reopening the cache if necessary.
|
virtual |
Pure virtual that must be overloaded by the inheriting class.
It is used to determine whether an object is ready to be ticked. This is required for example for all UObject derived classes as they might be loaded async and therefore won't be ready immediately.
|
virtual |
Used to determine if a rendering thread tickable object must have rendering in a non-suspended state during it's Tick function.
|
static |
Set the current PSO Game Usage Mask and comparsion function .
Returns true if this mask is different from the old mask or false if not or the cache system is disabled or if the mask feature is disabled Any new PSO's found will be logged with this value or existing PSO should have their masks updated. See FPipelineFileCache for more details.
|
virtual |
Pure virtual that must be overloaded by the inheriting class.
It will be called from within LevelTick.cpp after ticking all actors or from the rendering thread (depending on bIsRenderingThreadObject)
| DeltaTime | Game time passed since the last call. |