mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 03:55:33 +00:00
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:
parent
bd558efaaa
commit
1f10cac42a
@ -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);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user