Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
ShaderParamPreamble.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
11namespace PhosphorShaders {
12
19{
27 enum class Pool {
28 Scalar,
29 Color,
30 Image,
31 };
32
33 QString id;
35
41 int explicitSlot = -1;
42};
43
57PHOSPHORSHADERS_EXPORT QString buildParamPreamble(const QList<PreambleParam>& params);
58
63PHOSPHORSHADERS_EXPORT bool isValidParamId(const QString& id);
64
77PHOSPHORSHADERS_EXPORT QString spliceAfterVersion(const QString& source, const QString& block);
78
79} // namespace PhosphorShaders
Definition ShaderEffect.h:30
PHOSPHORSHADERS_EXPORT QString buildParamPreamble(const QList< PreambleParam > &params)
Build the generated #define p_<id> <glsl-accessor> preamble for a shader's declared parameters.
PHOSPHORSHADERS_EXPORT QString spliceAfterVersion(const QString &source, const QString &block)
Splice block into source immediately after its #version line, then emit a #line <n> 0 directive so th...
PHOSPHORSHADERS_EXPORT bool isValidParamId(const QString &id)
True if id is a valid GLSL identifier body ([A-Za-z0-9_], non-empty) — the p_ prefix supplies the lea...
One declared shader parameter, in metadata declaration order, as fed to buildParamPreamble.
Definition ShaderParamPreamble.h:19
Pool
Which UBO region the parameter occupies.
Definition ShaderParamPreamble.h:27
int explicitSlot
Explicit slot from metadata, or -1 to auto-assign by declaration order within the parameter's pool.
Definition ShaderParamPreamble.h:41
QString id
Definition ShaderParamPreamble.h:33
Pool pool
Definition ShaderParamPreamble.h:34