rhi: Skip comparing to this in isCompatible tests

Change-Id: Ie1855f992315f6e02986016a254127cec0ac94c8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
bb10
Laszlo Agocs 2020-09-25 11:27:19 +02:00
parent 89f7389494
commit 80091e0a0f
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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;