Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorSurfaceShaders::SurfaceUniforms Struct Reference

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]

Detailed Description

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.

Member Data Documentation

◆ _pad_after_audioSpectrum

int PhosphorSurfaceShaders::SurfaceUniforms::_pad_after_audioSpectrum[3]

◆ customColors

float PhosphorSurfaceShaders::SurfaceUniforms::customColors[16][4]

◆ customParams

float PhosphorSurfaceShaders::SurfaceUniforms::customParams[8][4]

◆ iAudioSpectrumSize

int PhosphorSurfaceShaders::SurfaceUniforms::iAudioSpectrumSize

◆ iChannelResolution

float PhosphorSurfaceShaders::SurfaceUniforms::iChannelResolution[4][4]

◆ iMouse

float PhosphorSurfaceShaders::SurfaceUniforms::iMouse[4]

◆ iTextureResolution

float PhosphorSurfaceShaders::SurfaceUniforms::iTextureResolution[4][4]

◆ iTime

float PhosphorSurfaceShaders::SurfaceUniforms::iTime

◆ qt_Matrix

float PhosphorSurfaceShaders::SurfaceUniforms::qt_Matrix[16]

◆ qt_Opacity

float PhosphorSurfaceShaders::SurfaceUniforms::qt_Opacity

◆ uBackdropRect

float PhosphorSurfaceShaders::SurfaceUniforms::uBackdropRect[4]

◆ uHasBackdrop

float PhosphorSurfaceShaders::SurfaceUniforms::uHasBackdrop

◆ uSurfaceFocused

float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceFocused

◆ uSurfaceFrameSize

float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceFrameSize[2]

◆ uSurfaceFrameTopLeft

float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceFrameTopLeft[2]

◆ uSurfaceOpacity

float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceOpacity

◆ uSurfaceScale

float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceScale

◆ uSurfaceSize

float PhosphorSurfaceShaders::SurfaceUniforms::uSurfaceSize[2]

The documentation for this struct was generated from the following file: