summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorTellowKrinkle <tellowkrinkle@gmail.com>2022-06-04 22:37:06 -0500
committerTellowKrinkle <tellowkrinkle@gmail.com>2022-06-14 21:51:58 -0500
commit3fe1a1a3d77bd4f3f15bd84cf76d164029b2ad31 (patch)
tree10b7178f14efe7bbd6ec2b6b6e18d5013b355386 /Source/Core/VideoCommon
parent431d757151f329780f99e606102f444787640d73 (diff)
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
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/ShaderGenCommon.h2
1 files changed, 2 insertions, 0 deletions
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>,
"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;