mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 19:45:33 +00:00
GPUThread: Fix command size blow-up
This commit is contained in:
parent
1405004fc0
commit
769e6f2bae
@ -54,16 +54,15 @@ enum class GPUBackendCommandType : u8
|
||||
DrawPreciseLine,
|
||||
};
|
||||
|
||||
struct alignas(16) GPUThreadCommand
|
||||
struct GPUThreadCommand
|
||||
{
|
||||
u32 size;
|
||||
GPUBackendCommandType type;
|
||||
|
||||
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.
|
||||
// NOTE: If we ever end up putting vectors in the command packets, this should be raised.
|
||||
constexpr u32 COMMAND_QUEUE_ALLOCATION_ALIGNMENT = alignof(GPUThreadCommand);
|
||||
// Ensure size is a multiple of 16 (minimum data size) so we don't end up with an unaligned command.
|
||||
constexpr u32 COMMAND_QUEUE_ALLOCATION_ALIGNMENT = 16;
|
||||
return Common::AlignUpPow2(size, COMMAND_QUEUE_ALLOCATION_ALIGNMENT);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user