diff options
author | Ben Fletcher <ben.fletcher@me.com> | 2022-12-06 19:52:59 -0800 |
---|---|---|
committer | Ben Fletcher <ben.fletcher@me.com> | 2022-12-11 11:05:24 -0800 |
commit | 0943b5d65d1a5699fb2085f4d92c9112fb08871d (patch) | |
tree | 35fd67535171a6683809149a541b3718b7d0e4b3 /src/gui/rhi/qshaderdescription_p.h | |
parent | 2fe3b0e5640df34d5512e06ecbc5739c2d4df21e (diff) |
RHI: QShaderDescription storage buffer qualifiers / run time stride
Add storage buffer memory qualifier and run time array stride information
to QShaderDescription::StorageBlock.
Memory qualifiers allow more informed selection of RHI resource buffer
binding (bufferLoad / bufferStore / bufferLoadStore) function.
Run time array stride (for last block member unsized array) allows
packing of buffer data for transfer to / from GPU. Without this
information, applications must infer or guess which packing rules
(std430 / std140) are in use.
Change-Id: I676d7e848afefd40d01cdd463c569b07022b683e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi/qshaderdescription_p.h')
-rw-r--r-- | src/gui/rhi/qshaderdescription_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/rhi/qshaderdescription_p.h b/src/gui/rhi/qshaderdescription_p.h index df4e8fd873..7e5412a784 100644 --- a/src/gui/rhi/qshaderdescription_p.h +++ b/src/gui/rhi/qshaderdescription_p.h @@ -170,6 +170,15 @@ public: }; Q_DECLARE_FLAGS(ImageFlags, ImageFlag) + enum QualifierFlag { + QualifierReadOnly = 1 << 0, + QualifierWriteOnly = 1 << 1, + QualifierCoherent = 1 << 2, + QualifierVolatile = 1 << 3, + QualifierRestrict = 1 << 4, + }; + Q_DECLARE_FLAGS(QualifierFlags, QualifierFlag) + // Optional data (like decorations) usually default to an otherwise invalid value (-1 or 0). This is intentional. struct InOutVariable { @@ -218,6 +227,8 @@ public: int binding = -1; int descriptorSet = -1; QList<BlockVariable> members; + int runtimeArrayStride = 0; + QualifierFlags qualifierFlags; }; QList<InOutVariable> inputVariables() const; @@ -310,6 +321,7 @@ private: }; Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderDescription::ImageFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderDescription::QualifierFlags) #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription &); |