From 3fe1a1a3d77bd4f3f15bd84cf76d164029b2ad31 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 4 Jun 2022 22:37:06 -0500 Subject: [PATCH] VideoCommon: Don't add garbage to shader uids in debug builds There wasn't anything stopping compilers from doing it in release builds either, but most optimizations would make the padding zero --- Source/Core/VideoCommon/ShaderGenCommon.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/VideoCommon/ShaderGenCommon.h b/Source/Core/VideoCommon/ShaderGenCommon.h index c9f0246318..88fb5c7353 100644 --- a/Source/Core/VideoCommon/ShaderGenCommon.h +++ b/Source/Core/VideoCommon/ShaderGenCommon.h @@ -71,6 +71,8 @@ public: static_assert(std::is_trivially_copyable_v, "uid_data must be a trivially copyable type"); + ShaderUid() { memset(GetUidData(), 0, GetUidDataSize()); } + bool operator==(const ShaderUid& obj) const { return memcmp(GetUidData(), obj.GetUidData(), GetUidDataSize()) == 0;