From 16381929ba4f217f92c9d469eb227642c0ac13ba Mon Sep 17 00:00:00 2001 From: Eladash Date: Sun, 5 Jun 2022 21:24:16 +0300 Subject: [PATCH] vm_var.h: Ensure 16-bytes alignment of gvar Some PPU instructions require memory to be aligned otherwise they produce different results. I've already seen their usage in cellSaveData disassembly so may as well ensure it for all. --- rpcs3/Emu/Memory/vm_var.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/Memory/vm_var.h b/rpcs3/Emu/Memory/vm_var.h index 323699ae6f..4231ab048b 100644 --- a/rpcs3/Emu/Memory/vm_var.h +++ b/rpcs3/Emu/Memory/vm_var.h @@ -172,7 +172,7 @@ namespace vm struct gvar final : ptr { static constexpr u32 alloc_size{sizeof(T) * Count}; - static constexpr u32 alloc_align{alignof(T)}; + static constexpr u32 alloc_align{std::max(alignof(T), 16)}; }; } // namespace ps3_ } // namespace vm