Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
AnimationShaderContract.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
7
8#include <QString>
9
11
171namespace AnimationShaderContract {
172
201inline constexpr const char* kITime = "iTime";
202
206inline constexpr const char* kIResolution = "iResolution";
207
213inline constexpr const char* kITimeDelta = "iTimeDelta";
214
221inline constexpr const char* kIFrame = "iFrame";
222
228inline constexpr const char* kIDate = "iDate";
229
242inline constexpr const char* kIIsReversed = "iIsReversed";
243
264inline constexpr const char* kISurfaceScreenPos = "iSurfaceScreenPos";
265
273inline constexpr const char* kIAnchorSize = "iAnchorSize";
274
290inline constexpr const char* kIAnchorPosInFbo = "iAnchorPosInFbo";
291
309inline constexpr const char* kIAnchorRectInTexture = "iAnchorRectInTexture";
310
322inline constexpr const char* kIFromRect = "iFromRect";
323inline constexpr const char* kIToRect = "iToRect";
324
332inline constexpr const char* kUOldWindow = "uOldWindow";
333
347inline constexpr const char* kIWindowOpacity = "iWindowOpacity";
348
363inline constexpr int kMaxUserTextureSlots = 3;
364
371inline constexpr const char* kIMouse = "iMouse";
372
379inline constexpr const char* kCustomParamsArray = "customParams";
380
394
400
408inline QString slotKey(int vec, char comp)
409{
411}
412
414inline QString slotKey(int slot)
415{
417}
418
442inline constexpr const char* kCustomColorsArray = "customColors";
444
452inline QString colorKey(int slot)
453{
455}
456
465
482
483} // namespace AnimationShaderContract
484
485} // namespace PhosphorAnimationShaders
486
487// The compile-time link between AnimationShaderContract::kMaxUserTextureSlots
488// and PhosphorRendering::kMaxUserTextures lives in
489// libs/phosphor-animation/src/contract_pins.cpp. It cannot live in this header
490// because translation units that only need contract definitions (notably the
491// kwin-effect, which already pulls in epoxy/gl.h via KWin) must not be forced
492// to also pull in <QtQuick/QSGTextureProvider> via ShaderNodeRhi.h — epoxy and
493// Qt's qopenglext.h declare overlapping GL function-pointer typedefs that
494// conflict when both end up in the same TU.
constexpr const char * kISurfaceScreenPos
vec4 iSurfaceScreenPos — the shader surface's position in screen coords plus the host screen dimensio...
Definition AnimationShaderContract.h:264
constexpr const char * kIAnchorPosInFbo
vec2 iAnchorPosInFbo is the anchor's top-left position inside the FBO, in logical pixels.
Definition AnimationShaderContract.h:290
constexpr const char * kIFromRect
vec4 iFromRect / vec4 iToRect — geometry-morph endpoints in logical screen pixels (x,...
Definition AnimationShaderContract.h:322
constexpr const char * kIAnchorSize
vec2 iAnchorSize — captured anchor (card) pixel size in logical pixels.
Definition AnimationShaderContract.h:273
QString slotKey(int vec, char comp)
Format a customParams slot key — thin forwarder onto PhosphorShaders::CustomParams::slotKey,...
Definition AnimationShaderContract.h:408
constexpr const char * kIAnchorRectInTexture
vec4 iAnchorRectInTexture — the card's UV sub-rect within uTexture0, as (x, y, width,...
Definition AnimationShaderContract.h:309
constexpr const char * kIResolution
vec2 iResolution — surface size in logical pixels.
Definition AnimationShaderContract.h:206
constexpr const char * kCustomColorsArray
vec4 customColors[N] — per-effect declared color parameter slots.
Definition AnimationShaderContract.h:442
constexpr int kMaxCustomColors
Definition AnimationShaderContract.h:443
constexpr int kMaxUserTextureSlots
Maximum number of user-declared textures per animation effect.
Definition AnimationShaderContract.h:363
constexpr const char * kIDate
vec4 iDate — local-time (year, month, day, seconds-since-midnight).
Definition AnimationShaderContract.h:228
constexpr int kMaxParameterSlots
Number of float sub-slots (4 per vec4 × 8 vec4s = 32).
Definition AnimationShaderContract.h:399
constexpr const char * kIToRect
Definition AnimationShaderContract.h:323
constexpr const char * kITimeDelta
float iTimeDelta — wall-clock seconds between consecutive paint ticks that fed this transition.
Definition AnimationShaderContract.h:213
constexpr const char * kIMouse
vec4 iMouse — cursor position in shader-local pixels.
Definition AnimationShaderContract.h:371
constexpr const char * kIWindowOpacity
float iWindowOpacity — the window's effective rule-resolved opacity in [0.0, 1.0],...
Definition AnimationShaderContract.h:347
constexpr const char * kITime
float iTime — transition progress in [0.0, 1.0].
Definition AnimationShaderContract.h:201
constexpr int kMaxCustomParams
Number of vec4 slots in the customParams array (8).
Definition AnimationShaderContract.h:393
constexpr const char * kUOldWindow
sampler2D uOldWindow — snapshot of the window's content captured at the old frame size just before th...
Definition AnimationShaderContract.h:332
QString colorKey(int slot)
Format a customColor slot key — thin forwarder onto PhosphorShaders::CustomColors::colorKey.
Definition AnimationShaderContract.h:452
constexpr const char * kIFrame
int iFrame — per-leg frame counter.
Definition AnimationShaderContract.h:221
constexpr const char * kCustomParamsArray
vec4 customParams[N] — per-effect declared parameter slots.
Definition AnimationShaderContract.h:379
constexpr const char * kIIsReversed
int iIsReversed — direction signal for asymmetric leg rendering.
Definition AnimationShaderContract.h:242
Definition AnimationShaderContract.h:10
QString colorKey(int slot)
Format a customColor key from a 0-based slot index.
Definition CustomParamsKey.h:133
constexpr int kColorCount
Number of color slots in BaseUniforms::customColors[16].
Definition CustomParamsKey.h:127
QString slotKey(int vec, char comp)
Format a customParams slot key from explicit (vec, comp) pair.
Definition CustomParamsKey.h:53
constexpr int kVecCount
Number of vec4 slots in BaseUniforms::customParams[8].
Definition CustomParamsKey.h:40
constexpr int kFlatSlotCount
Number of float sub-slots across all vec4s (4 × kVecCount).
Definition CustomParamsKey.h:46