diff --git a/Source/Core/VideoCommon/NativeVertexFormat.h b/Source/Core/VideoCommon/NativeVertexFormat.h index 89f3a06db5..c2761c9514 100644 --- a/Source/Core/VideoCommon/NativeVertexFormat.h +++ b/Source/Core/VideoCommon/NativeVertexFormat.h @@ -63,6 +63,9 @@ struct PortableVertexDeclaration std::array texcoords; AttributeFormat posmtx; + // Make sure we initialize padding to 0 since padding is included in the == memcmp + PortableVertexDeclaration() { memset(this, 0, sizeof(*this)); } + inline bool operator<(const PortableVertexDeclaration& b) const { return memcmp(this, &b, sizeof(PortableVertexDeclaration)) < 0; @@ -73,6 +76,9 @@ struct PortableVertexDeclaration } }; +static_assert(std::is_trivially_copyable_v, + "Make sure we can memset-initialize"); + namespace std { template <>