summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-09-15 14:33:01 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-17 10:46:36 +0000
commit4b14f3cd244d605c03e7652111e8a76d197806be (patch)
tree2795d02b7953dda9996e098b90d30ba800199ca7 /src/gui
parent0a1cefa4c58d2a668e816d1b1581bbbd85700b7a (diff)
rhi: document serializedLayoutDescription
The docs are internal still but won't hurt to keep them up-to-date. At the same time, enhance the QRhiRenderPassDescriptor serializedFormat() docs as well, with appropriate notes about the intended usage of the "serialized" data. Change-Id: I8425fff625903468621e3b09d089b345fada85f4 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit eda1276f80e39d519c88e7a491ff1d960c7a4dac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/rhi/qrhi.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index fb662acbfa..645c955173 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -2784,10 +2784,16 @@ QRhiResource::Type QRhiRenderPassDescriptor::resourceType() const
\fn QVector<quint32> QRhiRenderPassDescriptor::serializedFormat() const
\return a vector of integers containing an opaque blob describing the data
- relevant for \l{isCompatible()}{compatibility}. Given two
- QRhiRenderPassDescriptor objects \c rp1 and \c rp2, if the data returned
- from this function is identical, then \c{rp1->isCompatible(rp2)}, and vice
- versa hold true as well.
+ relevant for \l{isCompatible()}{compatibility}.
+
+ Given two QRhiRenderPassDescriptor objects \c rp1 and \c rp2, if the data
+ returned from this function is identical, then \c{rp1->isCompatible(rp2)},
+ and vice versa hold true as well.
+
+ \note The returned data is meant to be used for storing in memory and
+ comparisons during the lifetime of the QRhi the object belongs to. It is not
+ meant for storing on disk, reusing between processes, or using with multiple
+ QRhi instances with potentially different backends.
\sa isCompatible()
*/
@@ -3060,6 +3066,8 @@ QRhiResource::Type QRhiShaderResourceBindings::resourceType() const
is more efficient than iterating through two binding lists and calling
QRhiShaderResourceBinding::isLayoutCompatible() on each pair. This becomes
relevant especially when this function is called at a high frequency.
+
+ \sa serializedLayoutDescription()
*/
bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBindings *other) const
{
@@ -3078,6 +3086,25 @@ bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBind
&& m_layoutDesc == other->m_layoutDesc;
}
+/*!
+ \fn QVector<quint32> QRhiShaderResourceBindings::serializedLayoutDescription() const
+
+ \return a vector of integers containing an opaque blob describing the layout
+ of the binding list, i.e. the data relevant for
+ \l{isLayoutCompatible()}{layout compatibility tests}.
+
+ Given two objects \c srb1 and \c srb2, if the data returned from this
+ function is identical, then \c{srb1->isLayoutCompatible(srb2), and vice
+ versa hold true as well.
+
+ \note The returned data is meant to be used for storing in memory and
+ comparisons during the lifetime of the QRhi the object belongs to. It is not
+ meant for storing on disk, reusing between processes, or using with multiple
+ QRhi instances with potentially different backends.
+
+ \sa isLayoutCompatible()
+ */
+
void QRhiImplementation::updateLayoutDesc(QRhiShaderResourceBindings *srb)
{
srb->m_layoutDescHash = 0;