CPU/Recompiler: Get rid of non-constant offsetofs

This commit is contained in:
Connor McLaughlin
2021-05-12 02:26:58 +10:00
parent 4cb8817247
commit acda42be16
5 changed files with 15 additions and 18 deletions

View File

@ -84,6 +84,9 @@ struct State
std::array<u8, DCACHE_SIZE> dcache = {};
std::array<u32, ICACHE_LINES> icache_tags = {};
std::array<u8, ICACHE_SIZE> icache_data = {};
static constexpr u32 GPRRegisterOffset(u32 index) { return offsetof(State, regs.r) + (sizeof(u32) * index); }
static constexpr u32 GTERegisterOffset(u32 index) { return offsetof(State, gte_regs.r32) + (sizeof(u32) * index); }
};
extern State g_state;