GPUThread: Fix command size blow-up

This commit is contained in:
Stenzek 2025-04-21 19:10:18 +10:00
parent 1405004fc0
commit 769e6f2bae
No known key found for this signature in database

View File

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