IShaderFormat::RequiresSecondaryCompile

Predicate which should return true if a second preprocess & compilation is required given the initial preprocess output.

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

References

   
Module TargetPlatform
Header /Engine/Source/Developer/TargetPlatform/Public/Interfaces/IShaderFormat.h
Include #include "Interfaces/IShaderFormat.h"
virtual bool RequiresSecondaryCompile
(
    const [FShaderCompilerInput](API\Runtime\RenderCore\FShaderCompilerInput) & Input,
    const [FShaderCompilerEnvironment](API\Runtime\RenderCore\FShaderCompilerEnvironment) & Environment,
    const [FShaderPreprocessOutput](API\Runtime\RenderCore\FShaderPreprocessOutput) & PreprocessOutput
) const

Remarks

Predicate which should return true if a second preprocess & compilation is required given the initial preprocess output. Only called if SupportsIndependentPreprocessing returns true. This is generally be determined by analyzing the directives on the given preprocess output (which are set by the presence of UESHADERMETADATA directives in the original source), though other conditions are possible and up to the implementation. In the event this returns true, PreprocessShader will be called an additional time, with the bIsSecondary field on the FShaderPreprocessOutput set to true, and the overload of CompilePreprocessedShader taking two FShaderPreprocessOutput and two FShaderCompilerOutput objects will be called instead of the single object variants. Note that this is done instead of calling the single object variant twice so shader formats can statically distinguish primary compilation in a dual-compile case from the single-compile case.


Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library