From 80091e0a0f216dcdc91bb77c9f5ec1c8a929e75c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 25 Sep 2020 11:27:19 +0200 Subject: [PATCH] rhi: Skip comparing to this in isCompatible tests Change-Id: Ie1855f992315f6e02986016a254127cec0ac94c8 Reviewed-by: Paul Olav Tvete --- src/gui/rhi/qrhi.cpp | 6 ++++++ src/gui/rhi/qrhivulkan.cpp | 3 +++ 2 files changed, 9 insertions(+) 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;