RHI: Make sure to compare bindings when comparing QShaders

It is possible, at least with Metal, that after the shader is converted
to the native shader that the native bindings will changes, so it is
important to also make a comparison against the bindings as well.

Pick-to: 6.4
Change-Id: I8b6ff99fbda04ea66e3cb7970d7c33df066734cf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Andy Nichols 2022-08-25 14:53:59 +02:00
parent 612c345108
commit e020a8eaf7

View File

@ -516,8 +516,8 @@ QShaderKey::QShaderKey(QShader::Source s,
bool operator==(const QShader &lhs, const QShader &rhs) noexcept bool operator==(const QShader &lhs, const QShader &rhs) noexcept
{ {
return lhs.d->stage == rhs.d->stage return lhs.d->stage == rhs.d->stage
&& lhs.d->shaders == rhs.d->shaders; && lhs.d->shaders == rhs.d->shaders
// do not bother with desc and bindings, if the shader code is the same, the description must match too && lhs.d->bindings == rhs.d->bindings;
} }
/*! /*!