Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
IUniformExtension.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
6#include <PhosphorShaders/phosphorshaders_export.h>
7
8namespace PhosphorShaders {
9
17class PHOSPHORSHADERS_EXPORT IUniformExtension
18{
19public:
20 virtual ~IUniformExtension() = default;
21
30 virtual int extensionSize() const = 0;
31
34 virtual void write(char* buffer, int offset) const = 0;
35
37 virtual bool isDirty() const = 0;
38
40 virtual void clearDirty() = 0;
41
57 virtual bool requiresPhysicalResolution() const
58 {
59 return true;
60 }
61};
62
63} // namespace PhosphorShaders
Interface for appending custom uniform data after the base UBO layout.
Definition IUniformExtension.h:18
virtual ~IUniformExtension()=default
virtual bool isDirty() const =0
Whether the extension data has changed since the last write.
virtual bool requiresPhysicalResolution() const
Whether iResolution in this extension's UBO should be uploaded in PHYSICAL pixels (DPR-scaled,...
Definition IUniformExtension.h:57
virtual void clearDirty()=0
Mark as clean after a successful write.
virtual void write(char *buffer, int offset) const =0
Write extension data into buffer starting at offset.
virtual int extensionSize() const =0
Size in bytes of the extension region (must respect std140 alignment).
Definition ShaderEffect.h:28