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

IUboProfile implementation for the overlay/animation runtime — the legacy 672-byte BaseUniforms layout. More...

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

Inheritance diagram for PhosphorShaders::BaseUniformProfile:
[legend]

Public Member Functions

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

Detailed Description

IUboProfile implementation for the overlay/animation runtime — the legacy 672-byte BaseUniforms layout.

fill() is a faithful transcription of the historical ShaderNodeRhi::syncBaseUniforms() body (plus the iFlipBufferY=1 and the qt_Matrix Y-flip that previously lived in uploadDirtyTextures(), folded in here because they have no QRhi dependency once yUpInNDC is carried in the frame state). The one intentional departure: the iMouse normalized components divide in float (the frame state carries floats) rather than the historical double, a last-ULP difference the golden test pins to the float path. dirtyRegions() reproduces the exact legacy UboRegions dispatch.

Constructor & Destructor Documentation

◆ BaseUniformProfile()

PhosphorShaders::BaseUniformProfile::BaseUniformProfile ( )

◆ ~BaseUniformProfile()

PhosphorShaders::BaseUniformProfile::~BaseUniformProfile ( )
overridedefault

Member Function Documentation

◆ baseSize()

int PhosphorShaders::BaseUniformProfile::baseSize ( ) const
inlineoverridevirtual

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

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

Implements PhosphorShaders::IUboProfile.

◆ data()

const void * PhosphorShaders::BaseUniformProfile::data ( ) const
inlineoverridevirtual

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

Implements PhosphorShaders::IUboProfile.

◆ dirtyRegions()

UboUploadRegionList PhosphorShaders::BaseUniformProfile::dirtyRegions ( const UboDirtyFlags flags) const
overridevirtual

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.

Implements PhosphorShaders::IUboProfile.

◆ fill()

void PhosphorShaders::BaseUniformProfile::fill ( const UboFrameState state)
overridevirtual

Populate the UBO from a per-frame node snapshot.

Implementations read only the subset of state they need.

Implements PhosphorShaders::IUboProfile.

◆ hasAppFields()

bool PhosphorShaders::BaseUniformProfile::hasAppFields ( ) const
inlineoverridevirtual

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

Reimplemented from PhosphorShaders::IUboProfile.

◆ mutableData()

void * PhosphorShaders::BaseUniformProfile::mutableData ( )
inlineoverridevirtual

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

Implements PhosphorShaders::IUboProfile.

◆ setAppField0()

void PhosphorShaders::BaseUniformProfile::setAppField0 ( int  )
inlineoverridevirtual

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

Reimplemented from PhosphorShaders::IUboProfile.

◆ setAppField1()

void PhosphorShaders::BaseUniformProfile::setAppField1 ( int  value)
inlineoverridevirtual

Reimplemented from PhosphorShaders::IUboProfile.


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