diff options
| author | Merry <git@mary.rs> | 2022-08-29 21:23:23 +0100 |
|---|---|---|
| committer | Merry <git@mary.rs> | 2022-08-29 21:23:23 +0100 |
| commit | 362167fde56c4e0defd1ea472cd72514dfc77c0f (patch) | |
| tree | 6056b04daa61a91f3068892d322ce08be2f6fad9 /Source | |
| parent | 6d61e6a60135fa4faa849a757d29e5c26d8c8374 (diff) | |
MTLObjectCache: Correct signature of equality operator
Not doing so produces a warning in clang:
ISO C++20 considers use of overloaded operator '!=' (with operand types
'Metal::DepthStencilSelector' and 'Metal::DepthStencilSelector') to be
ambiguous despite there being a unique best viable function with
non-reversed arguments
The underlying reason for this warning is an incorrect method signature.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/VideoBackends/Metal/MTLObjectCache.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Metal/MTLObjectCache.h b/Source/Core/VideoBackends/Metal/MTLObjectCache.h index 86668e614d..d9f786b51f 100644 --- a/Source/Core/VideoBackends/Metal/MTLObjectCache.h +++ b/Source/Core/VideoBackends/Metal/MTLObjectCache.h @@ -37,8 +37,8 @@ struct DepthStencilSelector bool UpdateEnable() const { return value & 1; } enum CompareMode CompareMode() const { return static_cast<enum CompareMode>(value >> 1); } - bool operator==(const DepthStencilSelector& other) { return value == other.value; } - bool operator!=(const DepthStencilSelector& other) { return !(*this == other); } + bool operator==(const DepthStencilSelector& other) const { return value == other.value; } + bool operator!=(const DepthStencilSelector& other) const { return !(*this == other); } static constexpr size_t N_VALUES = 1 << 4; }; @@ -63,8 +63,8 @@ struct SamplerSelector WrapMode WrapV() const { return static_cast<WrapMode>((value >> 4) / 3); } bool AnisotropicFiltering() const { return ((value >> 3) & 1); } - bool operator==(const SamplerSelector& other) { return value == other.value; } - bool operator!=(const SamplerSelector& other) { return !(*this == other); } + bool operator==(const SamplerSelector& other) const { return value == other.value; } + bool operator!=(const SamplerSelector& other) const { return !(*this == other); } static constexpr size_t N_VALUES = (1 << 4) * 9; }; |
