Navigation
API > API/Plugins > API/Plugins/NiagaraShader
The set of shaders for a single script.
| Name | FNiagaraShaderMap |
| Type | class |
| Header File | /Engine/Plugins/FX/Niagara/Source/NiagaraShader/Public/NiagaraShared.h |
| Include Path | #include "NiagaraShared.h" |
Syntax
class FNiagaraShaderMap :
public TShaderMap< FNiagaraShaderMapContent, FNiagaraShaderMapPointerTable > ,
public FDeferredCleanupInterface
Inheritance Hierarchy
- FDeferredCleanupInterface → FNiagaraShaderMap
- FShaderMapBase → TShaderMap → FNiagaraShaderMap
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| NiagaraShared.h | |||
| NiagaraShared.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FNiagaraShaderMap() |
Destructor. | NiagaraShared.h |
Enums
Public
| Name | Remarks |
|---|---|
| EWorkerThread |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Super | TShaderMap< FNiagaraShaderMapContent, FNiagaraShaderMapPointerTable > | NiagaraShared.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| GIdToNiagaraShaderMap | TMap< FNiagaraShaderMapId, FNiagaraShaderMap * > | A global map from a script's ID and static switch set to any shader map cached for that script. | NiagaraShared.h |
| NiagaraShaderMapsBeingCompiled | TMap< FNiagaraShaderMapRef, TArray< FNiagaraShaderScript * > > | Tracks resources and their shader maps that need to be compiled but whose compilation is being deferred. | NiagaraShared.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCompilationFinalized | uint32 | Indicates whether this shader map has had ProcessCompilationResults called after Compile. | NiagaraShared.h | |
| bCompiledSuccessfully | uint32 | NiagaraShared.h | ||
| bDeletedThroughDeferredCleanup | bool | Used to catch errors where the shader map is deleted directly. | NiagaraShared.h | |
| bIsPersistent | uint32 | Indicates whether the shader map should be stored in the shader cache. | NiagaraShared.h | |
| bRegistered | uint32 | Indicates whether this shader map has been registered in GIdToNiagaraShaderMap | NiagaraShared.h | |
| CompilingId | uint32 | Uniquely identifies this shader map during compilation, needed for deferred compilation where shaders from multiple shader maps are compiled together. | NiagaraShared.h | |
| NumRefs | int32 | NiagaraShared.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddRef() |
Reference counting. | NiagaraShared.h | |
void Compile
(
FNiagaraShaderScript* Script, |
Compiles the shaders for a script and caches them in this shader map. | NiagaraShared.h | |
bool CompiledSuccessfully() |
NiagaraShared.h | ||
void CreateCompileJobs
(
const FNiagaraShaderType* ShaderType, |
Compiles the shaders for a script and caches them in this shader map. | NiagaraShared.h | |
uint32 GetCompilingId () |
NiagaraShared.h | ||
uint32 GetCompilingId () |
NiagaraShared.h | ||
int32 GetNumRefs() |
NiagaraShared.h | ||
TNiagaraShaderRef< ShaderType > GetShader
(
int32 PermutationId |
NiagaraShared.h | ||
TNiagaraShaderRef< FShader > GetShader
(
FShaderType* ShaderType, |
NiagaraShared.h | ||
void GetShaderList
(
TMap< FShaderId, TShaderRef< FShader > >& OutShaders |
Builds a list of the shaders in a shader map. | NiagaraShared.h | |
const FNiagaraShaderMapId & GetShaderMapId() |
Accessors. | NiagaraShared.h | |
EShaderPlatform GetShaderPlatform() |
NiagaraShared.h | ||
bool IsCompilationFinalized() |
NiagaraShared.h | ||
bool IsComplete
(
const FNiagaraShaderScript* Script, |
Checks whether the shader map is missing any shader types necessary for the given script. | NiagaraShared.h | |
bool IsValid() |
NiagaraShared.h | ||
void LoadMissingShadersFromMemory
(
const FNiagaraShaderScript* Script |
Attempts to load missing shaders from memory. | NiagaraShared.h | |
void ProcessAndFinalizeShaderCompileJob
(
const TRefCountPtr< FShaderCommonCompileJob >& SingleJob |
NiagaraShared.h | ||
bool ProcessCompilationResults
(
const TArray< FNiagaraShaderScript* >& InScripts, |
Sorts the incoming compiled jobs into the appropriate mesh shader maps, and finalizes this shader map so that it can be used for rendering. | NiagaraShared.h | |
void Register
(
EShaderPlatform InShaderPlatform |
Registers a niagara shader map in the global map so it can be used by Niagara scripts. | NiagaraShared.h | |
void Release() |
NiagaraShared.h | ||
void SaveToDerivedDataCache
(
const FNiagaraShaderScript* Script |
Saves this shader map to the derived data cache. | NiagaraShared.h | |
bool Serialize
(
FShaderSerializeContext& Ctx |
NiagaraShared.h | ||
| Serializes the shader map. | NiagaraShared.h | ||
void SetCompiledSuccessfully
(
bool bSuccess |
NiagaraShared.h | ||
bool TryToAddToExistingCompilationTask
(
FNiagaraShaderScript* Script |
Checks to see if the shader map is already being compiled for another script, and if so adds the specified script to the list to be applied to once the compile finishes. | NiagaraShared.h |
Overridden from FShaderMapBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void GetShaderList
(
TMap< FHashedName, TShaderRef< FShader > >& OutShaders |
NiagaraShared.h | ||
virtual void GetShaderPipelineList
(
TArray< FShaderPipelineRef >& OutShaderPipelines |
NiagaraShared.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FNiagaraShaderMap * FindId
(
const FNiagaraShaderMapId& ShaderMapId, |
Finds the shader map for a script. Finds the shader map for a script. | NiagaraShared.h | |
static TMap< FNiagaraShaderMapRef, TArray< FNiagaraShaderScript * > > & GetInFlightShaderMaps() |
NiagaraShared.h | ||
static const FNiagaraShaderMap * GetShaderMapBeingCompiled
(
const FNiagaraShaderScript* Script |
Finds a shader map currently being compiled that was enqueued for the given script. | NiagaraShared.h | |
static void LoadFromDerivedDataCache
(
const FNiagaraShaderScript* Script, |
Attempts to load the shader map for the given script from the Derived Data Cache. | NiagaraShared.h | |
static void RemovePendingMap
(
FNiagaraShaderMap* Map |
NiagaraShared.h | ||
static bool RemovePendingScript
(
FNiagaraShaderScript* Script |
Removes a Script from NiagaraShaderMapsBeingCompiled. | NiagaraShared.h |