From 107d337d77069a4fe2a3c60dcd361ce68027a72e Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Fri, 12 Nov 2021 00:53:46 +0530 Subject: [PATCH] Fix `MacroInterpreter::MethodAddress` Bitfield Padding Due to compiler alignment issues, the bitfield member `increment` of `MacroInterpreter::MethodAddress` was mistakenly padded and moved to the next byte. This has now been fixed by making its type `u16` like the member prior to it to prevent natural alignment from kicking in. --- .../skyline/soc/gm20b/engines/maxwell/macro_interpreter.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/macro_interpreter.h b/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/macro_interpreter.h index c7732931..6c5e4033 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/macro_interpreter.h +++ b/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/macro_interpreter.h @@ -90,7 +90,6 @@ namespace skyline::soc::gm20b::engine::maxwell3d { } bitfield; }; static_assert(sizeof(Opcode) == sizeof(u32)); - #pragma pack(pop) /** * @brief Metadata about the Maxwell 3D method to be called in 'Send' @@ -99,9 +98,11 @@ namespace skyline::soc::gm20b::engine::maxwell3d { u32 raw; struct { u16 address : 12; - u8 increment : 6; + u16 increment : 6; }; }; + static_assert(sizeof(MethodAddress) == sizeof(u32)); + #pragma pack(pop) Maxwell3D &maxwell3D; //!< A reference to the parent engine object