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:

committed by
Marge Bot

parent
9aeb5156bc
commit
0c2bbb470a
@@ -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;
|
||||
|
Reference in New Issue
Block a user