From 6afdff6023c16402a30e5e26d58d1438c94a6d90 Mon Sep 17 00:00:00 2001 From: booto Date: Sat, 25 Oct 2014 01:52:31 +0800 Subject: [PATCH] VideoCommon: loop bug in ShaderGenCommon.h debug --- Source/Core/VideoCommon/ShaderGenCommon.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/ShaderGenCommon.h b/Source/Core/VideoCommon/ShaderGenCommon.h index 0d2cb208c8..54adb1ba17 100644 --- a/Source/Core/VideoCommon/ShaderGenCommon.h +++ b/Source/Core/VideoCommon/ShaderGenCommon.h @@ -94,6 +94,7 @@ public: template uid_data2* GetUidData() { return &data; } const uid_data* GetUidData() const { return &data; } + const u8* GetUidDataRaw() const { return &values[0]; } size_t GetUidDataSize() const { return sizeof(values); } @@ -192,7 +193,7 @@ public: file << "\n\nShader uid:\n"; for (unsigned int i = 0; i < new_uid.GetUidDataSize(); ++i) { - u32 value = ((u32*)new_uid.GetUidData())[i]; + u8 value = new_uid.GetUidDataRaw()[i]; if ((i % 4) == 0) { auto last_value = (i+3 < new_uid.GetUidDataSize()-1) ? i+3 : new_uid.GetUidDataSize(); @@ -200,7 +201,7 @@ public: file << "Values " << std::setw(2) << i << " - " << last_value << ": "; } - file << std::setw(8) << std::setfill('0') << std::hex << value << std::setw(1); + file << std::setw(2) << std::setfill('0') << std::hex << value << std::setw(1); if ((i % 4) < 3) file << ' '; else