FShaderLibraryCooker

Windows
MacOS
Linux

References

Module

RenderCore

Header

/Engine/Source/Runtime/RenderCore/Public/ShaderCodeLibrary.h

Include

#include "ShaderCodeLibrary.h"

Syntax

struct FShaderLibraryCooker

Functions

Name Description

Public function Static

bool

 

AddShaderCode

(
    EShaderPlatform ShaderPlatform,
    const FShaderMapResourceCode* ...,
    const FShaderMapAssetPaths& Associ...
)

At cook time, add shader code to collection.

Public function Static

void

 

AddShaderStableKeyValue

(
    EShaderPlatform ShaderPlatform,
    FStableShaderKeyAndValue& StableKe...
)

At cook time, add the human readable key value information.

Public function Static

bool

 

BeginCookingLibrary

(
    FString const& Name
)

Opens a named library for cooking and sets it as the default.

Public function Static

void

 

CleanDirectories

(
    TArray< FName > const& ShaderForma...
)

Clean the cook directories.

Public function Static

void

 

CookShaderFormats

(
    TArray< FShaderFormatDescriptor > c...
)

Specify the shader formats to cook and which ones needs stable keys. Provide an array of FShaderFormatDescriptors.

Public function Static

bool

 

CreatePatchLibrary

(
    TArray< FString > const& OldMetaDa...,
    FString const& NewMetaDataDir,
    FString const& OutDir,
    bool bNativeFormat,
    bool bNeedsDeterministicOrder
)

Create a smaller 'patch' library that only contains data from 'NewMetaDataDir' not contained in any of 'OldMetaDataDirs'.

Public function Static

void

 

DumpShaderCodeStats()

Dump collected stats for each shader platform.

Public function Static

void

 

EndCookingLibrary

(
    FString const& Name
)

Close a named library.

Public function Static

void

 

InitForCooking

(
    bool bNativeFormat
)

Initialize the library cooker.

Public function Static

bool

 

IsShaderLibraryEnabled()

Whether storing shaders in the shader library is enabled

Public function Static

bool

 

NeedsShaderStableKeys

(
    EShaderPlatform ShaderPlatform
)

We check this early in the callstack to avoid creating a bunch of FName and keys and things we will never save anyway.

Public function Static

bool

 

SaveShaderLibraryChunk

(
    int32 ChunkId,
    const TSet< FName >& InPackagesInC...,
    const ITargetPlatform* TargetP...,
    const FString& SandboxDestinationP...,
    const FString& SandboxMetadataPath,
    TArray< FString >& OutChunkFilenam...
)

Saves a single chunk of the collected shader code (per shader platform).

Public function Static

bool

 

SaveShaderLibraryWithoutChunking

(
    const ITargetPlatform* TargetP...,
    FString const& Name,
    FString const& SandboxDestinationP...,
    FString const& SandboxMetadataPath,
    TArray< FString >& PlatformSCLCSVP...,
    FString& OutErrorMessage
)

Saves collected shader code to a single file per shader platform When chunking is enabled, this call will not write the shader code, only the SCL.CSV file with the stable shader info.

Public function Static

void

 

Shutdown()

Shutdown the library cooker.

Classes

Name

Description

Public struct

FShaderFormatDescriptor

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