Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
SurfaceUniformProfile.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
7#include <PhosphorSurface/phosphorsurface_export.h>
8
10
11namespace PhosphorSurfaceShaders {
12
28class PHOSPHORSURFACE_EXPORT SurfaceUniformProfile : public PhosphorShaders::IUboProfile
29{
30public:
32 ~SurfaceUniformProfile() override = default;
33
34 int baseSize() const override
35 {
36 return static_cast<int>(sizeof(SurfaceUniforms));
37 }
38
39 const void* data() const override
40 {
41 return &m_u;
42 }
43 void* mutableData() override
44 {
45 return &m_u;
46 }
47
48 void fill(const PhosphorShaders::UboFrameState& state) override;
49
51
52 // Surface UBO has no consumer escape-hatch int slots.
53 bool hasAppFields() const override
54 {
55 return false;
56 }
57
58 // fill() writes qt_Opacity from the frame state.
59 bool readsQtOpacity() const override
60 {
61 return true;
62 }
63
64private:
65 SurfaceUniforms m_u = {};
66};
67
68} // namespace PhosphorSurfaceShaders
Pluggable UBO concern for the shared shader render engine.
Definition IUboProfile.h:202
Fixed-capacity list of upload regions.
Definition IUboProfile.h:29
const void * data() const override
Read-only view of the filled UBO bytes (for updateDynamicBuffer).
Definition SurfaceUniformProfile.h:39
bool readsQtOpacity() const override
Whether fill() writes UboFrameState::qtOpacity into the buffer.
Definition SurfaceUniformProfile.h:59
int baseSize() const override
Byte size of the base UBO region (sizeof the concrete struct).
Definition SurfaceUniformProfile.h:34
PhosphorShaders::UboUploadRegionList dirtyRegions(const PhosphorShaders::UboDirtyFlags &flags) const override
Region(s) to upload for the given dirty flags, reproducing the legacy broader-subsumes-narrower dispa...
void fill(const PhosphorShaders::UboFrameState &state) override
Populate the UBO from a per-frame node snapshot.
void * mutableData() override
Mutable view — used by the node's multipass qt_Matrix pin/restore, which writes the leading mat4 dire...
Definition SurfaceUniformProfile.h:43
bool hasAppFields() const override
Whether this profile exposes the two consumer escape-hatch int slots.
Definition SurfaceUniformProfile.h:53
Definition DecorationProfile.h:31
Which conceptual blocks of the UBO changed since the last upload.
Definition IUboProfile.h:90
Snapshot of every node-side value a UBO profile's fill() may read for a single frame.
Definition IUboProfile.h:104
C++ mirror of the SURFACE shader contract's daemon UBO block — the #else (non-PLASMAZONES_KWIN) branc...
Definition SurfaceShaderUniforms.h:39