diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-09-02 13:44:23 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-03 20:50:01 +0000 |
commit | e118824f920097d1801f96e3dbd2ee4afb2cb64e (patch) | |
tree | 620aafb2e2737b48b89b8c4e17819e0d7bc655ee | |
parent | 976274a340464a68262955fe5d7090ebf8c49c7e (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.
Change-Id: Iee61848f058a06774550af6f38a3253956e4cfd3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 65cad49473af68bcf6353ac51411629e2613e01f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 2bf175f505..e79dc1e822 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -3024,8 +3024,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 { |