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

GPU uniform buffer layout following std140 rules (base region). More...

#include <phosphor-shaders/include/PhosphorShaders/BaseUniforms.h>

Public Attributes

float qt_Matrix [16]
 
float qt_Opacity
 
float iTime
 
float iTimeDelta
 
int iFrame
 
float iResolution [2]
 
int appField0
 
int appField1
 
float iMouse [4]
 
float iDate [4]
 
float customParams [8][4]
 
float customColors [16][4]
 
float iChannelResolution [4][4]
 
int iAudioSpectrumSize
 
int iFlipBufferY
 
int _pad_after_audioSpectrum [2]
 
float iTextureResolution [4][4]
 
float iTimeHi
 
int iIsReversed
 
int _pad_after_iIsReversed [2]
 

Detailed Description

GPU uniform buffer layout following std140 rules (base region).

This is the generic Shadertoy-compatible portion of the UBO. Consumers append application-specific data after this block via IUniformExtension.

The render node allocates sizeof(BaseUniforms) + extension->extensionSize() bytes for the UBO, writes the base region itself, and calls extension->write() for the remainder.

appField0 / appField1 escape hatch
Two consumer-defined int fields at offsets 88–95. They exist regardless of use because they fill the std140 alignment slot between iResolution (vec2) and iMouse (vec4) — removing them would break the layout.

Use them when you have a small (≤2 ints), frequently-updated piece of state that needs to live INSIDE BaseUniforms (rather than the extension region) — typically because the fragment shader reads them on every pixel and you want them on the same cache line as iResolution. For larger or differently-shaped state, implement IUniformExtension.

The library writes them via the K_APP_FIELDS UBO region (8 bytes) so frequent updates don't trigger a full scene-header re-upload. Consumers that don't use them should leave them at 0.

Member Data Documentation

◆ _pad_after_audioSpectrum

int PhosphorShaders::BaseUniforms::_pad_after_audioSpectrum[2]

◆ _pad_after_iIsReversed

int PhosphorShaders::BaseUniforms::_pad_after_iIsReversed[2]

◆ appField0

int PhosphorShaders::BaseUniforms::appField0

◆ appField1

int PhosphorShaders::BaseUniforms::appField1

◆ customColors

float PhosphorShaders::BaseUniforms::customColors[16][4]

◆ customParams

float PhosphorShaders::BaseUniforms::customParams[8][4]

◆ iAudioSpectrumSize

int PhosphorShaders::BaseUniforms::iAudioSpectrumSize

◆ iChannelResolution

float PhosphorShaders::BaseUniforms::iChannelResolution[4][4]

◆ iDate

float PhosphorShaders::BaseUniforms::iDate[4]

◆ iFlipBufferY

int PhosphorShaders::BaseUniforms::iFlipBufferY

◆ iFrame

int PhosphorShaders::BaseUniforms::iFrame

◆ iIsReversed

int PhosphorShaders::BaseUniforms::iIsReversed

◆ iMouse

float PhosphorShaders::BaseUniforms::iMouse[4]

◆ iResolution

float PhosphorShaders::BaseUniforms::iResolution[2]

◆ iTextureResolution

float PhosphorShaders::BaseUniforms::iTextureResolution[4][4]

◆ iTime

float PhosphorShaders::BaseUniforms::iTime

◆ iTimeDelta

float PhosphorShaders::BaseUniforms::iTimeDelta

◆ iTimeHi

float PhosphorShaders::BaseUniforms::iTimeHi

◆ qt_Matrix

float PhosphorShaders::BaseUniforms::qt_Matrix[16]

◆ qt_Opacity

float PhosphorShaders::BaseUniforms::qt_Opacity

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