PreprocessShader

Preprocess a shader.

Windows
MacOS
Linux

References

Module

ShaderPreprocessor

Header

/Engine/Source/Developer/ShaderPreprocessor/Public/ShaderPreprocessor.h

Include

#include "ShaderPreprocessor.h"

Source

/Engine/Source/Developer/ShaderPreprocessor/Private/ShaderPreprocessor.cpp

Syntax

bool PreprocessShader
(
    FString & OutPreprocessedShader,
    FShaderCompilerOutput & ShaderOutput,
    const FShaderCompilerInput & ShaderInput,
    const FShaderCompilerDefinitions & AdditionalDefines,
    EDumpShaderDefines DefinesPolicy
)

Remarks

Preprocess a shader.

Returns

true if the shader is preprocessed without error.

Parameters

Parameter

Description

OutPreprocessedShader

Upon return contains the preprocessed source code.

ShaderOutput

ShaderOutput to which errors can be added.

ShaderInput

The shader compiler input.

AdditionalDefines

Additional defines with which to preprocess the shader.

bShaderDumpDefinesAsCommentedCode

Whether to add shader definitions as comments.