From 1f10cac42a526dcbccf7dc8d64704f962df315ea Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 19 Apr 2025 22:45:19 +1000 Subject: [PATCH] GPUThread: Align commands to 16 bytes Apparently some of the types end up 16-byte aligned on Android x86_64. --- src/core/gpu_thread_commands.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/gpu_thread_commands.h b/src/core/gpu_thread_commands.h index cfdfe5015..44ad56eb7 100644 --- a/src/core/gpu_thread_commands.h +++ b/src/core/gpu_thread_commands.h @@ -54,7 +54,7 @@ enum class GPUBackendCommandType : u8 DrawPreciseLine, }; -struct GPUThreadCommand +struct alignas(16) GPUThreadCommand { u32 size; GPUBackendCommandType type; @@ -63,7 +63,7 @@ struct GPUThreadCommand { // Ensure size is a multiple of 8 (minimum data size) so we don't end up with an unaligned command. // NOTE: If we ever end up putting vectors in the command packets, this should be raised. - constexpr u32 COMMAND_QUEUE_ALLOCATION_ALIGNMENT = 8; + constexpr u32 COMMAND_QUEUE_ALLOCATION_ALIGNMENT = alignof(GPUThreadCommand); return Common::AlignUpPow2(size, COMMAND_QUEUE_ALLOCATION_ALIGNMENT); } };