GPUThread: Align commands to 16 bytes

Apparently some of the types end up 16-byte aligned on Android x86_64.
This commit is contained in:
Stenzek 2025-04-19 22:45:19 +10:00
parent bd558efaaa
commit 1f10cac42a
No known key found for this signature in database

View File

@ -54,7 +54,7 @@ enum class GPUBackendCommandType : u8
DrawPreciseLine, DrawPreciseLine,
}; };
struct GPUThreadCommand struct alignas(16) GPUThreadCommand
{ {
u32 size; u32 size;
GPUBackendCommandType type; 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. // 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. // 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); return Common::AlignUpPow2(size, COMMAND_QUEUE_ALLOCATION_ALIGNMENT);
} }
}; };