FNiagaraShaderScript

[FNiagaraShaderScript](API\Plugins\NiagaraShader\FNiagaraShaderScript) represents a Niagara script to the shader compilation process

Windows
MacOS
Linux

References

Module

NiagaraShader

Header

/Engine/Plugins/FX/Niagara/Source/NiagaraShader/Public/NiagaraShared.h

Include

#include "NiagaraShared.h"

Syntax

class FNiagaraShaderScript

Remarks

FNiagaraShaderScript represents a Niagara script to the shader compilation process

Constructors

Name Description

Public function

FNiagaraShaderScript()

Minimal initialization constructor.

Destructors

Name Description

Public function Virtual

~FNiagaraShaderScript()

Destructor

Functions

Name Description

Public function

void

 

AddCompileId

(
    uint32 Id
)

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Public function

bool

 

CacheShaders

(
    const FNiagaraShaderMapId& ShaderM...,
    bool bApplyCompletedShaderMapForRen...,
    bool bForceRecompile,
    bool bSynchronous
)

Caches the shaders for this script with no static parameters on the given platform.

Public function

bool

 

CacheShaders

(
    bool bApplyCompletedShaderMapForRen...,
    bool bForceRecompile,
    bool bSynchronous,
    const ITargetPlatform* TargetP...
)

Caches the shaders for this script with no static parameters on the given platform.

Public function

void

 

CancelCompilation()

Cancels all outstanding compilation jobs

Public function

void

 

DiscardShaderMap()

Public function

void

 

FinishCompilation()

Blocks until compilation has completed. Returns immediately if a compilation is not outstanding.

Public function

UNiagaraScri...

 

GetBaseVMScript()

Public function Const

const TArray...

 

GetCompileErrors()

Accessors.

Public function

TArray< FNia...

 

GetDataInterfaceParamInfo()

Public function Const

void

 

GetDependentShaderTypes

(
    EShaderPlatform Platform,
    TArray< FShaderType* >& OutSh...
)

Public function Const

ERHIFeatureL...

 

GetFeatureLevel()

Public function Const

const FStrin...

 

GetFriendlyName()

Public function Const

FNiagaraShad...

 

GetGameThreadShaderMap()

Public function Const

int32

 

GetNumPermutations()

Public function Const

int32

 

GetNumPermutations_RenderThread()

Public function Const

bool

 

GetScriptHLSLSource

(
    FString& OutSource
)

Get user source code for the shader

Public function Const

FNiagaraShad...

 

GetShader

(
    int32 PermutationId
)

Public function Const

FNiagaraShad...

 

GetShaderGameThread

(
    int32 PermutationId
)

Public function Virtual Const

void

 

GetShaderMapId

(
    EShaderPlatform Platform,
    const ITargetPlatform* TargetP...,
    FNiagaraShaderMapId& OutId
)

Protected function

void

 

GetShaderMapIDsWithUnfinishedCompilation

(
    TArray< int32 >& ShaderMapIds
)

Fills the passed array with IDs of shader maps unfinished compilation jobs.

Public function Const

EShaderPlatf...

 

GetShaderPlatform()

Public function Const

bool

 

GetUsesCompressedAttributes()

Public function Const

bool

 

GetUsesOldShaderStages()

Public function Const

bool

 

GetUsesSimulationStages()

Public function

void

 

Invalidate()

Public function Const

bool

 

IsCompilationFinished()

Checks if the compilation for this shader is finished

Public function Const

bool

 

IsEmitterConstantBufferUsed_RenderThread

(
    int32 Index
)

Public function Const

bool

 

IsExternalConstantBufferUsed_RenderThread

(
    int32 Index
)

Public function Const

bool

 

IsGlobalConstantBufferUsed_RenderThread

(
    int32 Index
)

Public function Const

bool

 

IsOwnerConstantBufferUsed_RenderThread

(
    int32 Index
)

Public function Virtual Const

bool

 

IsPersistent()

Should shaders compiled for this script be saved to disk?

Public function Const

bool

 

IsSame

(
    const FNiagaraShaderMapId& InId
)

Public function Const

bool

 

IsShaderMapComplete()

Public function Const

bool

 

IsShaderMapComplete_RenderThread()

Public function Const

bool

 

IsSystemConstantBufferUsed_RenderThread

(
    int32 Index
)

Public function Const

bool

 

IsViewUniformBufferUsed_RenderThread()

Public function Virtual

void

 

LegacySerialize

(
    FArchive& Ar
)

Serializes the script.

Public function Const

bool

 

MatchesScript

(
    ERHIFeatureLevel::Type InFeatureLev...,
    EShaderPlatform InShaderPlatform,
    const FNiagaraVMExecutableDataId& ...
)

Public function Virtual Const

void

 

ModifyCompilationEnvironment

(
    FShaderCompilerEnvironment& OutEnv...
)

Allow Niagara script the opportunity to modify the compilation environment for GPU simulations.

Public function Virtual

void

 

NotifyCompilationFinished()

Called when compilation finishes, after the GameThreadShaderMap is set and the render command to set the RenderThreadShaderMap is queued

Public function

FOnNiagaraSc...

 

OnCompilationComplete()

Public function Const

int32

 

PermutationIdToShaderStageIndex

(
    int32 PermutationId
)

Public function

bool

 

QueueForRelease

(
    FThreadSafeBool& Fence
)

Public function

void

 

ReleaseShaderMap()

Releases this script's shader map.

Public function

void

 

RemoveOutstandingCompileId

(
    const int32 OldOutstandingCompileSh...
)

Public function

void

 

SerializeShaderMap

(
    FArchive& Ar
)

Public function

void

 

SetCompileErrors

(
    const TArray< FString >& InCompile...
)

Public function

void

 

SetCompileErrors

(
    TArray< FString >& InErrors
)

Public function

void

 

SetDataInterfaceParamInfo

(
    const TArray< FNiagaraDataInterface...
)

Protected function

void

 

SetFeatureLevel

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Public function

void

 

SetGameThreadShaderMap

(
    FNiagaraShaderMap* InShaderMap
)

SetRenderingThreadShaderMap must also be called with the same value, but from the rendering thread.

Public function

void

 

SetHlslOutput

(
    const FString& InHlslOutput
)

Public function

void

 

SetRenderingThreadShaderMap

(
    FNiagaraShaderMap* InShaderMap
)

SetGameThreadShaderMap must also be called with the same value, but from the game thread.

Public function

void

 

SetRenderThreadCachedData

(
    const FNiagaraShaderMapCachedData&...
)

Public function

void

 

SetScript

(
    UNiagaraScriptBase* InScript,
    ERHIFeatureLevel::Type InFeatureLev...,
    EShaderPlatform InShaderPlatform,
    const FGuid& InCompilerVersion,
    const TArray< FString >& InAdditio...,
    const TArray< FString >& InAdditio...,
    const FNiagaraCompileHash& InBaseC...,
    const TArray< FNiagaraCompileHash >...,
    bool bInUsesRapidIterationParams,
    FString InFriendlyName
)

Public function

void

 

SetShaderMap

(
    FNiagaraShaderMap* InShaderMap
)

Public function

void

 

SetSourceName

(
    FString InSourceName
)

Public function Const

int32

 

ShaderStageIndexToPermutationId_RenderThread

(
    int32 ShaderStageIndex
)

Public function Virtual Const

bool

 

ShouldCache

(
    EShaderPlatform Platform,
    const FShaderType* ShaderType
)

Should the shader for this script with the given platform, shader type and vertex factory type combination be compiled

Protected function

void

 

UpdateCachedData_All()

Protected function

void

 

UpdateCachedData_PostCompile

(
    bool bCalledFromSerialize
)

Protected function

void

 

UpdateCachedData_PreCompile()

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss