diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-25 11:27:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-25 16:58:59 +0200 |
commit | 80091e0a0f216dcdc91bb77c9f5ec1c8a929e75c (patch) | |
tree | 6457d7f0ce85eb87d85c7d24dc1c3e66931d394b /src | |
parent | 89f7389494c6fc917f189150e06ed1fcfaa238e8 (diff) |
rhi: Skip comparing to this in isCompatible tests
Change-Id: Ie1855f992315f6e02986016a254127cec0ac94c8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 6 | ||||
-rw-r--r-- | src/gui/rhi/qrhivulkan.cpp | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index d4ffc4d180..a54d7ac405 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -2800,6 +2800,12 @@ QRhiResource::Type QRhiShaderResourceBindings::resourceType() const */ bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBindings *other) const { + if (other == this) + return true; + + if (!other) + return false; + const int count = m_bindings.count(); if (count != other->m_bindings.count()) return false; diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 1a0431e19d..7abfe37be1 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -5845,6 +5845,9 @@ static inline bool attachmentDescriptionEquals(const VkAttachmentDescription &a, bool QVkRenderPassDescriptor::isCompatible(const QRhiRenderPassDescriptor *other) const { + if (other == this) + return true; + if (!other) return false; |