summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-09-02 13:44:23 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-09-03 17:14:59 +0200
commit65cad49473af68bcf6353ac51411629e2613e01f (patch)
treecfaef53f65ab1df5361fa7e357e667d44a88af27 /src/gui/rhi
parent6cdf95a970f499f7d724e79638856a71942dd30d (diff)
rhi: Correct a doc note
It is not true that isLayoutCompatible() can be called before create(). That used to be the case before the optimizations have been added. The docs are still internal, but let's fix it up. Pick-to: 6.2 Change-Id: Iee61848f058a06774550af6f38a3253956e4cfd3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r--src/gui/rhi/qrhi.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index 228fc91ce3..70c8bf5813 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -3018,8 +3018,12 @@ QRhiResource::Type QRhiShaderResourceBindings::resourceType() const
then safely be passed to QRhiCommandBuffer::setShaderResources(), and so
be used with the pipeline in place of this QRhiShaderResourceBindings.
- This function can be called before create() as well. The bindings must
- already be set via setBindings() however.
+ \note This function must only be called after a successful create(), because
+ it relies on data generated during the baking of the underlying data
+ structures. This way the function can implement a comparison approach that
+ 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.
*/
bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBindings *other) const
{