mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 01:00:10 +01:00
agx: Add agx_size_align_16 helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
This commit is contained in:
parent
9aeb5156bc
commit
0c2bbb470a
1 changed files with 12 additions and 0 deletions
|
|
@ -61,6 +61,18 @@ enum agx_size {
|
|||
AGX_SIZE_64 = 2
|
||||
};
|
||||
|
||||
static inline unsigned
|
||||
agx_size_align_16(enum agx_size size)
|
||||
{
|
||||
switch (size) {
|
||||
case AGX_SIZE_16: return 1;
|
||||
case AGX_SIZE_32: return 2;
|
||||
case AGX_SIZE_64: return 4;
|
||||
}
|
||||
|
||||
unreachable("Invalid size");
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
/* Sufficient for as many SSA values as we need. Immediates and uniforms fit in 16-bits */
|
||||
unsigned value : 22;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue