Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
ShaderIncludeResolver.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <PhosphorShaders/phosphorshaders_export.h>
7
8#include <QString>
9#include <QStringList>
10
11namespace PhosphorShaders {
12
22class PHOSPHORSHADERS_EXPORT ShaderIncludeResolver
23{
24public:
25 static constexpr int MaxIncludeDepth = 10;
26
29 static constexpr qint64 MaxIncludeBytes = 1 << 20;
30
34 static constexpr qsizetype MaxExpandedSize = 16 << 20;
35
43 static constexpr const char* GeneratedPreambleInclude = "p_generated.glsl";
44
73 static QString expandIncludes(const QString& source, const QString& currentFileDir, const QStringList& includePaths,
74 QString* outError = nullptr, QStringList* outIncludedPaths = nullptr,
75 QStringList* outSourcePaths = nullptr);
76};
77
78} // namespace PhosphorShaders
Resolves include directives in GLSL shader source.
Definition ShaderIncludeResolver.h:23
static constexpr int MaxIncludeDepth
Definition ShaderIncludeResolver.h:25
static constexpr const char * GeneratedPreambleInclude
Reserved include name for the generated p_<id> autocomplete sidecar (plasmazones-shader-validate --em...
Definition ShaderIncludeResolver.h:43
static QString expandIncludes(const QString &source, const QString &currentFileDir, const QStringList &includePaths, QString *outError=nullptr, QStringList *outIncludedPaths=nullptr, QStringList *outSourcePaths=nullptr)
Expand include directives in source.
static constexpr qsizetype MaxExpandedSize
Largest expanded source, in UTF-16 code units.
Definition ShaderIncludeResolver.h:34
static constexpr qint64 MaxIncludeBytes
Largest include file, in bytes.
Definition ShaderIncludeResolver.h:29
Definition ShaderProfile.h:21