IShaderFormat

[IShaderFormat](API\Developer\TargetPlatform\Interfaces\IShaderFormat), shader pre-compilation abstraction

Windows
MacOS
Linux

References

Module

TargetPlatform

Header

/Engine/Source/Developer/TargetPlatform/Public/Interfaces/IShaderFormat.h

Include

#include "Interfaces/IShaderFormat.h"

Syntax

class IShaderFormat

Remarks

IShaderFormat, shader pre-compilation abstraction

Destructors

Name Description

Public function Virtual

~IShaderFormat()

Virtual destructor.

Functions

Name Description

Public function Virtual Const

void

 

AppendToKeyString

(
    FString& KeyString
)

Appends shader key text to the provided key string for use in DDC unique key construction.

Public function Virtual Const

bool

 

CanCompileBinaryShaders()

Can the shader format compile shaders to the native binary format for the platform.

Public function Virtual Const

bool

 

CanStripShaderCode

(
    bool const bNativeFormat
)

Can this shader format strip shader code for packaging in a shader library?

Public function Const

void

 

CompileShader

(
    FName Format,
    const FShaderCompilerInput& Input,
    FShaderCompilerOutput& Output,
    const FString& WorkingDirectory
)

Compile the specified shader.

Public function Virtual Const

bool

 

CreateShaderArchive

(
    FString const& LibraryName,
    FName Format,
    const FString& WorkingDirectory,
    const FString& OutputDir,
    const FString& DebugOutputDir,
    const FSerializedShaderArchive& Se...,
    const TArray< TArray< uint8 >>& Sh...,
    TArray< FString >* OutputFiles
)

Create a format specific archive for precompiled shader code.

Public function Const

const TCHAR ...

 

GetPlatformIncludeDirectory()

Returns name of directory with platform specific shaders.

Public function Const

void

 

GetSupportedFormats

(
    TArray< FName >& OutFormats
)

Gets the list of supported formats.

Public function Const

uint32

 

GetVersion

(
    FName Format
)

Gets the current version of the specified shader format.

Public function Virtual Const

void

 

ModifyShaderCompilerInput

(
    FShaderCompilerInput& Input
)

Called before a shader is compiled to allow the platform shader format to modify the shader compiler input, e.g. by adding console variable values relevant to shader compilation on that platform.

Public function Virtual Const

void

 

NotifyShaderCooked

(
    const TConstArrayView< uint8 >& Pl...,
    FName Format
)

Called when a shader resource is cooked, so the shader format can perform platform-specific operations on the debug data.

Public function Virtual Const

bool

 

StripShaderCode

(
    TArray< uint8 >& Code,
    FString const& DebugOutputDir,
    bool const bNative
)

Strips the shader bytecode provided of any unnecessary optional data elements when archiving shaders into the shared library.

Public function Virtual Const

bool

 

SupportsShaderArchives()

Whether this shader format supports a format-specific archive for precompiled shader code.

Public function Virtual Const

bool

 

UsesHLSLcc

(
    const FShaderCompilerInput& Input
)

Can the shader compiler use the HLSLcc library when compiling shaders

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