UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FShaderCodeLibrary Struct Reference

#include <ShaderCodeLibrary.h>

Static Public Member Functions

static RENDERCORE_API void PreInit ()
 
static RENDERCORE_API void InitForRuntime (EShaderPlatform ShaderPlatform)
 
static RENDERCORE_API void Shutdown ()
 
static RENDERCORE_API bool IsEnabled ()
 
static RENDERCORE_API bool AreShaderMapsPreloadedAtLoadTime ()
 
static RENDERCORE_API void AddKnownChunkIDs (const int32 *IDs, const int32 NumChunkIDs)
 
static RENDERCORE_API bool OpenLibrary (FString const &Name, FString const &Directory, bool bMonolithicOnly=false)
 
static RENDERCORE_API void CloseLibrary (FString const &Name)
 
static RENDERCORE_API bool ContainsShaderCode (const FSHAHash &Hash)
 
static RENDERCORE_API bool ContainsShaderCode (const FSHAHash &Hash, const FString &LogicalLibraryName)
 
static RENDERCORE_API TRefCountPtr< FShaderMapResourceLoadResource (const FSHAHash &Hash, FArchive *Ar)
 
static RENDERCORE_API bool PreloadShader (const FSHAHash &Hash, FArchive *Ar)
 
static RENDERCORE_API bool ReleasePreloadedShader (const FSHAHash &Hash)
 
static RENDERCORE_API FVertexShaderRHIRef CreateVertexShader (EShaderPlatform Platform, const FSHAHash &Hash)
 
static RENDERCORE_API FPixelShaderRHIRef CreatePixelShader (EShaderPlatform Platform, const FSHAHash &Hash)
 
static RENDERCORE_API FGeometryShaderRHIRef CreateGeometryShader (EShaderPlatform Platform, const FSHAHash &Hash)
 
static RENDERCORE_API FComputeShaderRHIRef CreateComputeShader (EShaderPlatform Platform, const FSHAHash &Hash)
 
static RENDERCORE_API FMeshShaderRHIRef CreateMeshShader (EShaderPlatform Platform, const FSHAHash &Hash)
 
static RENDERCORE_API FAmplificationShaderRHIRef CreateAmplificationShader (EShaderPlatform Platform, const FSHAHash &Hash)
 
static RENDERCORE_API FRayTracingShaderRHIRef CreateRayTracingShader (EShaderPlatform Platform, const FSHAHash &Hash, EShaderFrequency Frequency)
 
static RENDERCORE_API uint32 GetShaderCount (void)
 
static RENDERCORE_API EShaderPlatform GetRuntimeShaderPlatform (void)
 
static RENDERCORE_API void SafeAssignHash (FRHIShader *InShader, const FSHAHash &Hash)
 
static RENDERCORE_API FDelegateHandle RegisterSharedShaderCodeRequestDelegate_Handle (const FSharedShaderCodeRequest::FDelegate &Delegate)
 
static RENDERCORE_API void UnregisterSharedShaderCodeRequestDelegate_Handle (FDelegateHandle Handle)
 
static RENDERCORE_API void DontOpenPluginShaderLibraryOnMount (const FString &PluginName)
 
static RENDERCORE_API void OpenPluginShaderLibrary (IPlugin &Plugin, bool bMonolithicOnly=true)
 

Member Function Documentation

◆ AddKnownChunkIDs()

void FShaderCodeLibrary::AddKnownChunkIDs ( const int32 IDs,
const int32  NumChunkIDs 
)
static

Makes a number of ChunkIDs known to the library.

Normally the library is tracking chunk IDs runtime itself by listening to the pak mounted notifications. However, sometimes shaderbytecode files are moved between the chunks by the packaging code can can end up being preloaded. Takes C array and not TArray because that makes easier to hardcode the chunk IDs (which is the intended use case for this function).

◆ AreShaderMapsPreloadedAtLoadTime()

bool FShaderCodeLibrary::AreShaderMapsPreloadedAtLoadTime ( )
static

◆ CloseLibrary()

void FShaderCodeLibrary::CloseLibrary ( FString const &  Name)
static

Close a named library.

At runtime this will release the library data and further requests for shaders from this library will fail.

◆ ContainsShaderCode() [1/2]

bool FShaderCodeLibrary::ContainsShaderCode ( const FSHAHash Hash)
static

◆ ContainsShaderCode() [2/2]

bool FShaderCodeLibrary::ContainsShaderCode ( const FSHAHash Hash,
const FString &  LogicalLibraryName 
)
static

◆ CreateAmplificationShader()

FAmplificationShaderRHIRef FShaderCodeLibrary::CreateAmplificationShader ( EShaderPlatform  Platform,
const FSHAHash Hash 
)
static

◆ CreateComputeShader()

FComputeShaderRHIRef FShaderCodeLibrary::CreateComputeShader ( EShaderPlatform  Platform,
const FSHAHash Hash 
)
static

◆ CreateGeometryShader()

FGeometryShaderRHIRef FShaderCodeLibrary::CreateGeometryShader ( EShaderPlatform  Platform,
const FSHAHash Hash 
)
static

◆ CreateMeshShader()

FMeshShaderRHIRef FShaderCodeLibrary::CreateMeshShader ( EShaderPlatform  Platform,
const FSHAHash Hash 
)
static

◆ CreatePixelShader()

FPixelShaderRHIRef FShaderCodeLibrary::CreatePixelShader ( EShaderPlatform  Platform,
const FSHAHash Hash 
)
static

◆ CreateRayTracingShader()

FRayTracingShaderRHIRef FShaderCodeLibrary::CreateRayTracingShader ( EShaderPlatform  Platform,
const FSHAHash Hash,
EShaderFrequency  Frequency 
)
static

◆ CreateVertexShader()

FVertexShaderRHIRef FShaderCodeLibrary::CreateVertexShader ( EShaderPlatform  Platform,
const FSHAHash Hash 
)
static

◆ DontOpenPluginShaderLibraryOnMount()

void FShaderCodeLibrary::DontOpenPluginShaderLibraryOnMount ( const FString &  PluginName)
static

◆ GetRuntimeShaderPlatform()

EShaderPlatform FShaderCodeLibrary::GetRuntimeShaderPlatform ( void  )
static

◆ GetShaderCount()

uint32 FShaderCodeLibrary::GetShaderCount ( void  )
static

◆ InitForRuntime()

void FShaderCodeLibrary::InitForRuntime ( EShaderPlatform  ShaderPlatform)
static

This is the real initialization function.

◆ IsEnabled()

bool FShaderCodeLibrary::IsEnabled ( )
static

◆ LoadResource()

TRefCountPtr< FShaderMapResource > FShaderCodeLibrary::LoadResource ( const FSHAHash Hash,
FArchive Ar 
)
static

◆ OpenLibrary()

bool FShaderCodeLibrary::OpenLibrary ( FString const &  Name,
FString const &  Directory,
bool  bMonolithicOnly = false 
)
static

Open a named library.

At runtime this will open the shader library with this name.

Parameters
Nameis a high level description of the library (usually a project name or "Global")
Directorylocation of the .ushadercode file
bMonolithicOnlyIf true, only attempt to open a monolithic library (no chunks)
Returns
true if successful

◆ OpenPluginShaderLibrary()

void FShaderCodeLibrary::OpenPluginShaderLibrary ( IPlugin Plugin,
bool  bMonolithicOnly = true 
)
static

◆ PreInit()

void FShaderCodeLibrary::PreInit ( )
static

Adds the hooks for OnPakFileMounted, since pak opening normally happens earlier.

◆ PreloadShader()

bool FShaderCodeLibrary::PreloadShader ( const FSHAHash Hash,
FArchive Ar 
)
static

◆ RegisterSharedShaderCodeRequestDelegate_Handle()

FDelegateHandle FShaderCodeLibrary::RegisterSharedShaderCodeRequestDelegate_Handle ( const FSharedShaderCodeRequest::FDelegate &  Delegate)
static

◆ ReleasePreloadedShader()

bool FShaderCodeLibrary::ReleasePreloadedShader ( const FSHAHash Hash)
static

◆ SafeAssignHash()

void FShaderCodeLibrary::SafeAssignHash ( FRHIShader InShader,
const FSHAHash Hash 
)
static

◆ Shutdown()

void FShaderCodeLibrary::Shutdown ( )
static

◆ UnregisterSharedShaderCodeRequestDelegate_Handle()

void FShaderCodeLibrary::UnregisterSharedShaderCodeRequestDelegate_Handle ( FDelegateHandle  Handle)
static

The documentation for this struct was generated from the following files: