Navigation
API > API/Runtime > API/Runtime/RenderCore
Structure that provides an array of #include dependencies for a given root shader file, including not just immediate dependencies, but recursive dependencies from children as well. Not exhaustive, as it does not include platform specific or generated files, although it does include children of "/Engine/Generated/Material.ush", as derived from "/Engine/Private/MaterialTemplate.ush". Take the example of ClearUAV.usf:
/Engine/Private/Tools/ClearUAV.usf #include "../Common.ush" /Engine/Private/Common.ush #include "/Engine/Public/Platform.ush" #include "PackUnpack.ush" /Engine/Public/Platform.ush #include "FP16Math.ush"
The above is a small subset, but the above (and many more) would all show up as elements in Dependencies: PathInSource ParentPath ResultPath
../Common.ush /Engine/Private/Tools/ClearUAV.usf /Engine/Private/Common.ush /Engine/Public/Platform.ush /Engine/Private/Common.ush /Engine/Public/Platform.ush PackUnpack.ush /Engine/Private/Common.ush /Engine/Private/PackUnpack.ush FP16Math.ush /Engine/Public/Platform.ush /Engine/Public/FP16Math.ush
The goal of this structure is to allow a shader preprocessor implementation to fetch most of the source dependencies in a single query of the loaded shader cache, and then efficiently search for dependencies encountered in the shader source code, without needing to do string operations to resolve paths (such as converting relative paths like "../Common.ush" to "/Engine/Private/Common.ush"). Besides that, the array organization can be used to manage encountered source files by index, rather than needing a map, and the "ResultPath" strings from this structure can be referenced by pointer, rather than needing to dynamically allocate a copy of the resolved path. Lookups by PathInSource can use a much faster case sensitive hash, because PathInSource has verbatim capitalization from the source code files. Altogether, this utility structure saves a bunch of shader cache query, hash, map, string, and memory allocation overhead.
| Name | FShaderPreprocessDependencies |
| Type | struct |
| Header File | /Engine/Source/Runtime/RenderCore/Public/ShaderCompilerCore.h |
| Include Path | #include "ShaderCompilerCore.h" |
Syntax
struct FShaderPreprocessDependencies
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ByResult | FHashTable | ShaderCompilerCore.h | ||
| BySource | FHashTable | ShaderCompilerCore.h | ||
| Dependencies | TArray< FShaderPreprocessDependency > | First item in array contains stripped source for root file, and is not in the hash tables. | ShaderCompilerCore.h |