mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
C++20: Synthesize operator!=
From operator==
The inequality operator is automatically generated by the compiler if `operator==` is defined.
This commit is contained in:
@ -60,7 +60,6 @@ struct AbstractPipelineConfig
|
||||
rhs.rasterization_state.hex, rhs.depth_state.hex, rhs.blending_state.hex,
|
||||
rhs.framebuffer_state.hex, rhs.usage);
|
||||
}
|
||||
bool operator!=(const AbstractPipelineConfig& rhs) const { return !operator==(rhs); }
|
||||
bool operator<(const AbstractPipelineConfig& rhs) const
|
||||
{
|
||||
return std::tie(vertex_format, vertex_shader, geometry_shader, pixel_shader,
|
||||
|
@ -43,7 +43,6 @@ struct GXPipelineUid
|
||||
{
|
||||
return std::memcmp(this, &rhs, sizeof(*this)) == 0;
|
||||
}
|
||||
bool operator!=(const GXPipelineUid& rhs) const { return !operator==(rhs); }
|
||||
};
|
||||
struct GXUberPipelineUid
|
||||
{
|
||||
@ -64,7 +63,6 @@ struct GXUberPipelineUid
|
||||
{
|
||||
return std::memcmp(this, &rhs, sizeof(*this)) == 0;
|
||||
}
|
||||
bool operator!=(const GXUberPipelineUid& rhs) const { return !operator==(rhs); }
|
||||
};
|
||||
|
||||
// Disk cache of pipeline UIDs. We can't use the whole UID as a type as it contains pointers.
|
||||
|
@ -15,8 +15,3 @@ bool FBInfo::operator==(const FBInfo& other) const
|
||||
return m_height == other.m_height && m_width == other.m_width &&
|
||||
m_texture_format == other.m_texture_format;
|
||||
}
|
||||
|
||||
bool FBInfo::operator!=(const FBInfo& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ struct FBInfo
|
||||
TextureFormat m_texture_format = TextureFormat::I4;
|
||||
u32 CalculateHash() const;
|
||||
bool operator==(const FBInfo& other) const;
|
||||
bool operator!=(const FBInfo& other) const;
|
||||
};
|
||||
|
||||
struct FBInfoHasher
|
||||
|
@ -47,7 +47,6 @@ union RasterizationState
|
||||
}
|
||||
|
||||
bool operator==(const RasterizationState& rhs) const { return hex == rhs.hex; }
|
||||
bool operator!=(const RasterizationState& rhs) const { return !operator==(rhs); }
|
||||
bool operator<(const RasterizationState& rhs) const { return hex < rhs.hex; }
|
||||
|
||||
BitField<0, 2, CullMode> cullmode;
|
||||
@ -73,7 +72,6 @@ union FramebufferState
|
||||
}
|
||||
|
||||
bool operator==(const FramebufferState& rhs) const { return hex == rhs.hex; }
|
||||
bool operator!=(const FramebufferState& rhs) const { return !operator==(rhs); }
|
||||
|
||||
BitField<0, 8, AbstractTextureFormat> color_texture_format;
|
||||
BitField<8, 8, AbstractTextureFormat> depth_texture_format;
|
||||
@ -108,7 +106,6 @@ union DepthState
|
||||
}
|
||||
|
||||
bool operator==(const DepthState& rhs) const { return hex == rhs.hex; }
|
||||
bool operator!=(const DepthState& rhs) const { return !operator==(rhs); }
|
||||
bool operator<(const DepthState& rhs) const { return hex < rhs.hex; }
|
||||
|
||||
BitField<0, 1, u32> testenable;
|
||||
@ -143,7 +140,6 @@ union BlendingState
|
||||
}
|
||||
|
||||
bool operator==(const BlendingState& rhs) const { return hex == rhs.hex; }
|
||||
bool operator!=(const BlendingState& rhs) const { return !operator==(rhs); }
|
||||
bool operator<(const BlendingState& rhs) const { return hex < rhs.hex; }
|
||||
|
||||
BitField<0, 1, u32> blendenable;
|
||||
@ -185,7 +181,6 @@ struct SamplerState
|
||||
}
|
||||
|
||||
bool operator==(const SamplerState& rhs) const { return Hex() == rhs.Hex(); }
|
||||
bool operator!=(const SamplerState& rhs) const { return !operator==(rhs); }
|
||||
bool operator<(const SamplerState& rhs) const { return Hex() < rhs.Hex(); }
|
||||
|
||||
constexpr u64 Hex() const { return tm0.hex | (static_cast<u64>(tm1.hex) << 32); }
|
||||
|
@ -80,8 +80,6 @@ public:
|
||||
return memcmp(GetUidData(), obj.GetUidData(), GetUidDataSize()) == 0;
|
||||
}
|
||||
|
||||
bool operator!=(const ShaderUid& obj) const { return !operator==(obj); }
|
||||
|
||||
// determines the storage order inside STL containers
|
||||
bool operator<(const ShaderUid& obj) const
|
||||
{
|
||||
|
@ -63,7 +63,6 @@ struct TextureAndTLUTFormat
|
||||
return texfmt == other.texfmt;
|
||||
}
|
||||
|
||||
bool operator!=(const TextureAndTLUTFormat& other) const { return !operator==(other); }
|
||||
TextureFormat texfmt;
|
||||
TLUTFormat tlutfmt;
|
||||
};
|
||||
|
@ -13,11 +13,6 @@ bool TextureConfig::operator==(const TextureConfig& o) const
|
||||
std::tie(o.width, o.height, o.levels, o.layers, o.samples, o.format, o.flags, o.type);
|
||||
}
|
||||
|
||||
bool TextureConfig::operator!=(const TextureConfig& o) const
|
||||
{
|
||||
return !operator==(o);
|
||||
}
|
||||
|
||||
MathUtil::Rectangle<int> TextureConfig::GetRect() const
|
||||
{
|
||||
return {0, 0, static_cast<int>(width), static_cast<int>(height)};
|
||||
|
@ -59,7 +59,6 @@ struct TextureConfig
|
||||
}
|
||||
|
||||
bool operator==(const TextureConfig& o) const;
|
||||
bool operator!=(const TextureConfig& o) const;
|
||||
MathUtil::Rectangle<int> GetRect() const;
|
||||
MathUtil::Rectangle<int> GetMipRect(u32 level) const;
|
||||
size_t GetStride() const;
|
||||
|
Reference in New Issue
Block a user