Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
ShaderEntryPoint.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 <QList>
9#include <QString>
10#include <QStringList>
11
12namespace PhosphorShaders {
13
25{
27 QString functionName;
28
36
44 QStringList alsoRequires{};
45
46 bool operator==(const EntryCandidate&) const = default;
47};
48
56PHOSPHORSHADERS_EXPORT bool definesMain(const QString& expandedSource);
57
64PHOSPHORSHADERS_EXPORT bool definesFunction(const QString& expandedSource, const QString& functionName);
65
84PHOSPHORSHADERS_EXPORT QString composeEntryPoint(const QString& expandedSource,
85 const QList<EntryCandidate>& candidates);
86
97PHOSPHORSHADERS_EXPORT QString assembleEntryPoint(const QString& raw, const QString& prologue,
98 const QList<EntryCandidate>& candidates);
99
104PHOSPHORSHADERS_EXPORT QString stripGlslComments(const QString& source);
105
106} // namespace PhosphorShaders
Definition ShaderEffect.h:30
PHOSPHORSHADERS_EXPORT QString stripGlslComments(const QString &source)
Strip GLSL line (//…) and block (/* … *&zwj;/) comments from source, preserving newlines inside block co...
PHOSPHORSHADERS_EXPORT bool definesFunction(const QString &expandedSource, const QString &functionName)
True if expandedSource defines a function named functionName.
PHOSPHORSHADERS_EXPORT QString composeEntryPoint(const QString &expandedSource, const QList< EntryCandidate > &candidates)
Compose the fragment entry point (T1.4).
PHOSPHORSHADERS_EXPORT bool definesMain(const QString &expandedSource)
True if expandedSource defines void main() at top level.
PHOSPHORSHADERS_EXPORT QString assembleEntryPoint(const QString &raw, const QString &prologue, const QList< EntryCandidate > &candidates)
Convenience wrapper for the full assembly: when candidates is empty or raw already defines main(),...
One candidate entry function the author may define, paired with the void main() the harness generates...
Definition ShaderEntryPoint.h:25
QString generatedMain
The complete void main() { ... } the harness appends when functionName is defined.
Definition ShaderEntryPoint.h:35
QString functionName
Name of the entry function the author defines, e.g. "pZone".
Definition ShaderEntryPoint.h:27
QStringList alsoRequires
Additional function names that must ALSO be defined for this candidate to match — for direction-dispa...
Definition ShaderEntryPoint.h:44
bool operator==(const EntryCandidate &) const =default