C++ mirror of the SURFACE shader contract's daemon UBO block — the #else (non-PLASMAZONES_KWIN) branch of data/surface/shared/ surface_uniforms.glsl, a std140 layout(std140, binding = 0) uniform SurfaceUniforms { … }. More...
#include <PhosphorSurface/SurfaceShaderUniforms.h>
Public Attributes | |
| float | qt_Matrix [16] |
| float | qt_Opacity |
| float | uSurfaceScale |
| float | uSurfaceFocused |
| float | iTime |
| float | uSurfaceSize [2] |
| float | uSurfaceFrameTopLeft [2] |
| float | uSurfaceFrameSize [2] |
| float | uHasBackdrop |
| float | uSurfaceOpacity |
| float | customParams [8][4] |
| float | customColors [16][4] |
| float | iChannelResolution [4][4] |
| int | iAudioSpectrumSize |
| int | _pad_after_audioSpectrum [3] |
| float | iMouse [4] |
| float | iTextureResolution [4][4] |
| float | uBackdropRect [4] |
C++ mirror of the SURFACE shader contract's daemon UBO block — the #else (non-PLASMAZONES_KWIN) branch of data/surface/shared/ surface_uniforms.glsl, a std140 layout(std140, binding = 0) uniform SurfaceUniforms { … }.
The daemon's Qt-RHI surface-shader runtime uploads this struct byte-for-byte to binding 0; the compositor takes the classic default-block branch instead and never touches this layout.
This is a DIFFERENT layout from PhosphorShaders::BaseUniforms (overlay/animation), not a smaller one — both are 672 bytes, and past the shared qt_Matrix / qt_Opacity lead (and iTextureResolution, at 592 in both) the members do not line up. Surface decoration needs only geometry + focus + time + the pack parameter slots, and it binds its samplers differently (uTexture0 at binding 11, iChannel0-7 at bindings 2-9 — none of which are UBO members; only iChannelResolution sizes live here).
The per-field std140 offset static_asserts below PIN the byte layout the GLSL UBO branch depends on. If a field is reordered/resized here, the corresponding assert fails at compile time and surface_uniforms.glsl's #else block (and every surface effect.frag that encodes customParams[N] slot positions via #define p_<id> preambles) MUST be updated to match.
std140 note: the three trailing geometry vec2s (uSurfaceSize / uSurfaceFrameTopLeft / uSurfaceFrameSize) end at offset 104. The two floats uHasBackdrop (104) and uSurfaceOpacity (108) fill what would otherwise be an 8-byte hole before customParams (a vec4 array, 16-byte-aligned), which lands at offset 112 exactly as the GLSL compiler places it.
| int PhosphorSurfaceShaders::SurfaceUniforms::_pad_after_audioSpectrum[3] |
| float PhosphorSurfaceShaders::SurfaceUniforms::customColors[16][4] |
| float PhosphorSurfaceShaders::SurfaceUniforms::customParams[8][4] |
| int PhosphorSurfaceShaders::SurfaceUniforms::iAudioSpectrumSize |
| float PhosphorSurfaceShaders::SurfaceUniforms::iChannelResolution[4][4] |
| float PhosphorSurfaceShaders::SurfaceUniforms::iMouse[4] |
| float PhosphorSurfaceShaders::SurfaceUniforms::iTextureResolution[4][4] |
| float PhosphorSurfaceShaders::SurfaceUniforms::iTime |
| float PhosphorSurfaceShaders::SurfaceUniforms::qt_Matrix[16] |
| float PhosphorSurfaceShaders::SurfaceUniforms::qt_Opacity |
| float PhosphorSurfaceShaders::SurfaceUniforms::uBackdropRect[4] |
| float PhosphorSurfaceShaders::SurfaceUniforms::uHasBackdrop |
| float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceFocused |
| float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceFrameSize[2] |
| float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceFrameTopLeft[2] |
| float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceOpacity |
| float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceScale |
| float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceSize[2] |