Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorShaders::IUboProfile Class Referenceabstract

Pluggable UBO concern for the shared shader render engine. More...

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

Inheritance diagram for PhosphorShaders::IUboProfile:
[legend]

Public Member Functions

virtual ~IUboProfile ()=default
 
virtual int baseSize () const =0
 Byte size of the base UBO region (sizeof the concrete struct).
 
virtual const void * data () const =0
 Read-only view of the filled UBO bytes (for updateDynamicBuffer).
 
virtual void * mutableData ()=0
 Mutable view — used by the node's multipass qt_Matrix pin/restore, which writes the leading mat4 directly at offset 0.
 
virtual void fill (const UboFrameState &state)=0
 Populate the UBO from a per-frame node snapshot.
 
virtual UboUploadRegionList fullUploadRegions () const
 Region(s) covering the whole base struct, for the first (full) upload.
 
virtual UboUploadRegionList dirtyRegions (const UboDirtyFlags &flags) const =0
 Region(s) to upload for the given dirty flags, reproducing the legacy broader-subsumes-narrower dispatch.
 
virtual bool hasAppFields () const
 Whether this profile exposes the two consumer escape-hatch int slots.
 
virtual void setAppField0 (int)
 Write the consumer's escape-hatch int slots. No-op by default.
 
virtual void setAppField1 (int)
 

Detailed Description

Pluggable UBO concern for the shared shader render engine.

ShaderNodeRhi owns the SRB/pipeline/multipass/binding machinery; the ONLY part that varies between the overlay/animation runtime and a future surface-decoration runtime is the uniform buffer: its struct, byte size, per-frame fill, and dirty-upload region dispatch. This interface abstracts exactly that seam — bindings stay unabstracted because the surface binding map (UBO@0, iChannel0-3@2-5, uTexture0@7) is a strict subset of the overlay map.

Implementations hold their concrete UBO POD struct and expose its bytes via data()/mutableData() so the node can drive updateDynamicBuffer directly.

Constructor & Destructor Documentation

◆ ~IUboProfile()

virtual PhosphorShaders::IUboProfile::~IUboProfile ( )
virtualdefault

Member Function Documentation

◆ baseSize()

virtual int PhosphorShaders::IUboProfile::baseSize ( ) const
pure virtual

Byte size of the base UBO region (sizeof the concrete struct).

Drives the node's UBO allocation and the IUniformExtension offset.

Implemented in PhosphorShaders::BaseUniformProfile.

◆ data()

virtual const void * PhosphorShaders::IUboProfile::data ( ) const
pure virtual

Read-only view of the filled UBO bytes (for updateDynamicBuffer).

Implemented in PhosphorShaders::BaseUniformProfile.

◆ dirtyRegions()

virtual UboUploadRegionList PhosphorShaders::IUboProfile::dirtyRegions ( const UboDirtyFlags flags) const
pure virtual

Region(s) to upload for the given dirty flags, reproducing the legacy broader-subsumes-narrower dispatch.

Returns a fixed-capacity list — this runs per dirty frame and must not allocate.

Implemented in PhosphorShaders::BaseUniformProfile.

◆ fill()

virtual void PhosphorShaders::IUboProfile::fill ( const UboFrameState state)
pure virtual

Populate the UBO from a per-frame node snapshot.

Implementations read only the subset of state they need.

Implemented in PhosphorShaders::BaseUniformProfile.

◆ fullUploadRegions()

virtual UboUploadRegionList PhosphorShaders::IUboProfile::fullUploadRegions ( ) const
inlinevirtual

Region(s) covering the whole base struct, for the first (full) upload.

◆ hasAppFields()

virtual bool PhosphorShaders::IUboProfile::hasAppFields ( ) const
inlinevirtual

Whether this profile exposes the two consumer escape-hatch int slots.

Reimplemented in PhosphorShaders::BaseUniformProfile.

◆ mutableData()

virtual void * PhosphorShaders::IUboProfile::mutableData ( )
pure virtual

Mutable view — used by the node's multipass qt_Matrix pin/restore, which writes the leading mat4 directly at offset 0.

Implemented in PhosphorShaders::BaseUniformProfile.

◆ setAppField0()

virtual void PhosphorShaders::IUboProfile::setAppField0 ( int  )
inlinevirtual

Write the consumer's escape-hatch int slots. No-op by default.

Reimplemented in PhosphorShaders::BaseUniformProfile.

◆ setAppField1()

virtual void PhosphorShaders::IUboProfile::setAppField1 ( int  )
inlinevirtual

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