Skip to content

Commit

Permalink
RHI: Make sure to compare bindings when comparing QShaders
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nezticle committed Aug 25, 2022
1 parent 612c345 commit e020a8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/rhi/qshader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*!
Expand Down

0 comments on commit e020a8e

Please sign in to comment.