]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/blend.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / blend.h
index 50ea13bd28a897bd6bc3fa491baffaeb66cb8ab4..874230c682c9ccf82e21c88a644f1dc61aa6034d 100644 (file)
@@ -67,12 +67,23 @@ struct Blend
        BlendFactor dst_factor = ZERO;
        Color constant = { 0.0f, 0.0f, 0.0f, 0.0f };
        ColorWriteMask write_mask = WRITE_ALL;
+       bool alpha_to_coverage = false;
 
        Blend() = default;
        Blend(BlendFactor, BlendFactor);
        Blend(BlendEquation, BlendFactor, BlendFactor);
+
+       bool operator==(const Blend &) const;
+       bool operator!=(const Blend &b) const { return !operator==(b); }
 };
 
+inline bool Blend::operator==(const Blend &other) const
+{
+       return enabled==other.enabled && equation==other.equation && src_factor==other.src_factor &&
+               dst_factor==other.dst_factor && constant==other.constant && write_mask==other.write_mask &&
+               alpha_to_coverage==other.alpha_to_coverage;
+}
+
 
 inline ColorWriteMask operator|(ColorWriteMask m1, ColorWriteMask m2)
 { return static_cast<ColorWriteMask>(static_cast<int>(m1)|static_cast<int>(m2)); }