7#include <QLatin1String>
41 return wrap == QLatin1String(
"clamp") || wrap == QLatin1String(
"repeat") || wrap == QLatin1String(
"mirror");
50 return filter == QLatin1String(
"linear") || filter == QLatin1String(
"nearest") || filter == QLatin1String(
"mipmap");
79namespace CustomParams {
100 if (vec < 0 || vec >=
kVecCount || (comp !=
'x' && comp !=
'y' && comp !=
'z' && comp !=
'w')) {
103 return QStringLiteral(
"customParams") + QString::number(vec + 1) + QLatin1Char(
'_') + QLatin1Char(comp);
122 static constexpr char kComponents[4] = {
'x',
'y',
'z',
'w'};
123 return slotKey(slot / 4, kComponents[slot & 3]);
138 static constexpr char kComponents[4] = {
'x',
'y',
'z',
'w'};
139 return QStringLiteral(
"customParams[") + QString::number(slot / 4) + QStringLiteral(
"].")
140 + QLatin1Char(kComponents[slot & 3]);
172namespace CustomColors {
186 return QStringLiteral(
"customColor") + QString::number(slot + 1);
199 return QStringLiteral(
"customColors[") + QString::number(slot) + QLatin1Char(
']');
QString colorKey(int slot)
Format a customColor key from a 0-based slot index.
Definition CustomParamsKey.h:181
QString glslAccessor(int slot)
GLSL author-facing accessor for a color slot — the form a shader author reads in fragment source,...
Definition CustomParamsKey.h:194
constexpr int kColorCount
Number of color slots in BaseUniforms::customColors[16].
Definition CustomParamsKey.h:175
QString slotKey(int vec, char comp)
Format a customParams slot key from explicit (vec, comp) pair.
Definition CustomParamsKey.h:95
constexpr int kVecCount
Number of vec4 slots in BaseUniforms::customParams[8].
Definition CustomParamsKey.h:82
constexpr int kFlatSlotCount
Number of float sub-slots across all vec4s (4 × kVecCount).
Definition CustomParamsKey.h:88
QString glslAccessor(int slot)
GLSL author-facing accessor for a flat scalar sub-slot — the form a shader author reads in fragment s...
Definition CustomParamsKey.h:133
Definition ShaderEffect.h:33
constexpr double kMaxBufferScale
Definition CustomParamsKey.h:20
constexpr double kMinBufferScale
Lower / upper bounds on a multipass bufferScale (FBO downscale factor).
Definition CustomParamsKey.h:19
bool isValidFilterToken(const QString &filter)
The accepted buffer filter vocabulary: linear / nearest / mipmap.
Definition CustomParamsKey.h:48
constexpr int kMaxBufferPasses
Maximum number of multipass buffer passes a pack may declare.
Definition CustomParamsKey.h:27
bool isValidWrapToken(const QString &wrap)
The accepted texture / buffer wrap vocabulary, shared by every validation site across the shader regi...
Definition CustomParamsKey.h:39