From cb7707f8557baf1e0c9c5ebfa2863b6a484a6b8c Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Thu, 25 Aug 2022 14:53:59 +0200 Subject: [PATCH] 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. Change-Id: I8b6ff99fbda04ea66e3cb7970d7c33df066734cf Reviewed-by: Laszlo Agocs (cherry picked from commit e020a8eaf7dbc2adf9064b3e3794dc289264ebab) Reviewed-by: Qt Cherry-pick Bot --- src/gui/rhi/qshader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp index 1992708ba42..23e4f8f2beb 100644 --- a/src/gui/rhi/qshader.cpp +++ b/src/gui/rhi/qshader.cpp @@ -516,8 +516,8 @@ QShaderKey::QShaderKey(QShader::Source s, bool operator==(const QShader &lhs, const QShader &rhs) noexcept { return lhs.d->stage == rhs.d->stage - && 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->shaders == rhs.d->shaders + && lhs.d->bindings == rhs.d->bindings; } /*!