Resolves #include directives in GLSL shader source.
More...
#include <phosphor-shaders/include/PhosphorShaders/ShaderIncludeResolver.h>
|
| static QString | expandIncludes (const QString &source, const QString ¤tFileDir, const QStringList &includePaths, QString *outError=nullptr, QStringList *outIncludedPaths=nullptr) |
| | Expand #include directives in source.
|
| |
Resolves #include directives in GLSL shader source.
Supports:
- #include "path" — search relative to current file's directory, then include paths
- #include <path> — search only in include paths (e.g. global shaders dir)
◆ expandIncludes()
| static QString PhosphorShaders::ShaderIncludeResolver::expandIncludes |
( |
const QString & |
source, |
|
|
const QString & |
currentFileDir, |
|
|
const QStringList & |
includePaths, |
|
|
QString * |
outError = nullptr, |
|
|
QStringList * |
outIncludedPaths = nullptr |
|
) |
| |
|
static |
Expand #include directives in source.
- Parameters
-
| source | Raw shader source (may contain #include "..." or #include <...>) |
| currentFileDir | Directory of the file that contains source |
| includePaths | Directories to search for includes |
| outError | If non-null, set on error (file not found, depth exceeded) |
| outIncludedPaths | If non-null, appended with the canonical absolute path of every successfully-resolved include file. Lets callers fingerprint transitively-included headers (e.g. for cache invalidation) — without this, a cache keyed only on the top-level shader's mtime serves stale baked SPIR-V when an included header changes. |
- Returns
- Expanded source, or empty string on error
◆ MaxIncludeDepth
| constexpr int PhosphorShaders::ShaderIncludeResolver::MaxIncludeDepth = 10 |
|
staticconstexpr |
The documentation for this class was generated from the following file: