IShaderFormat

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

Unreal Engine C++ API Reference > Developer > TargetPlatform > Interfaces

Inheritance Hierarchy

  • IShaderFormat

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

Type Name Description
  ~IShaderFormat () Virtual destructor.

Functions

Type Name Description
void AppendToKeyString ( FString& KeyString ) Appends shader key text to the provided key string for use in DDC unique key construction.
bool CanCompileBinaryShaders () Can the shader format compile shaders to the native binary format for the platform.
bool CanStripShaderCode ( bool const bNativeFormat ) Can this shader format strip shader code for packaging in a shader library?
void CompilePreprocessedShader ( const FShaderCompilerInput& Input, const FShaderPreprocessOutput& Pri..., const FShaderPreprocessOutput& Sec..., FShaderCompilerOutput& PrimaryOutp..., FShaderCompilerOutput& SecondaryOu..., const FString& WorkingDirectory ) Compile the specified preprocessed shaders; only called if SupportsIndependentPreprocessing returns true, and the call to RequiresSecondaryCompile given the first preprocess output also returns true.
void CompilePreprocessedShader ( const FShaderCompilerInput& Input, const FShaderPreprocessOutput& Pre..., FShaderCompilerOutput& Output, const FString& WorkingDirectory ) Compile the specified preprocessed shader; only called if SupportsIndependentPreprocessing returns true
void CompileShader ( FName Format, const FShaderCompilerInput& Input, FShaderCompilerOutput& Output, const FString& WorkingDirectory ) Compile the specified shader. Only called if SupportsIndependentPreprocessing returns false.
bool CreateShaderArchive ( FString const& LibraryName, FName ShaderFormatAndShaderPlatform..., 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.
int32 GetPackedShaderKey () Virtual function that can be implemented by backends which require secondary compilation to specify a unique "key" identifier for the packing scheme (for validation in the runtime at load).
const TCHAR ... GetPlatformIncludeDirectory () Returns name of directory with platform specific shaders.
void GetSupportedFormats ( TArray< FName >& OutFormats ) Gets the list of supported formats.
uint32 GetVersion ( FName Format ) Gets the current version of the specified shader format.
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.
void NotifyShaderCompiled ( 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.
void NotifyShaderCompilersShutdown ( FName Format ) Called at the end of a cook to free resources and finalize artifacts created during the cook.
void OutputDebugData ( const FShaderCompilerInput& Input, const FShaderPreprocessOutput& Pre..., const FShaderCompilerOutput& Outpu... ) Implement to output debug info for a single compile job; only called if SupportsIndependentPreprocessing returns true.
void OutputDebugData ( const FShaderCompilerInput& Input, const FShaderPreprocessOutput& Pre..., const FShaderPreprocessOutput& Sec..., const FShaderCompilerOutput& Outpu..., const FShaderCompilerOutput& Secon... ) Implement to output debug info for the case where a secondary preprocessed shader was created.
bool PreprocessShader ( const FShaderCompilerInput& Input, const FShaderCompilerEnvironment& ..., FShaderPreprocessOutput& Preproces... ) Executes all shader preprocessing steps; only called if SupportsIndependentPreprocessing returns true
bool RequiresSecondaryCompile ( const FShaderCompilerInput& Input, const FShaderCompilerEnvironment& ..., const FShaderPreprocessOutput& Pre... ) Predicate which should return true if a second preprocess & compilation is required given the initial preprocess output.
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.
bool SupportsIndependentPreprocessing () Return true if preprocessing for this format can be executed independent of compilation (i.e. the format has an implementation of the PreprocessShader function).
bool SupportsShaderArchives () Whether this shader format supports a format-specific archive for precompiled shader code.

Deprecated Functions

Type Name Description
bool UsesHLSLcc ( const FShaderCompilerInput& Input ) UsesHLSLcc function is no longer used

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library