mirror of https://github.com/zeldaret/mm.git
Texture alignment macros (#284)
* Add ALIGNED8 * Add designated initializer macro * Update include/command_macros_base.h Co-authored-by: rylieb <31797144+rylieb@users.noreply.github.com> * Remove braces Co-authored-by: rylieb <31797144+rylieb@users.noreply.github.com>
This commit is contained in:
parent
418e09bf6f
commit
fcb09f5e28
|
@ -3,7 +3,7 @@
|
|||
|
||||
/**
|
||||
* Command Base macros intended for use in designing of more specific command macros
|
||||
* Each macro packs bytes (B), halfowrds (H) and words (W, for consistency) into a single word
|
||||
* Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word
|
||||
*/
|
||||
|
||||
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
|
||||
|
@ -16,6 +16,12 @@
|
|||
|
||||
#define CMD_W(a) (a)
|
||||
|
||||
#define CMD_PTR(a) (u32)(a)
|
||||
#ifdef __GNUC__
|
||||
#define CMD_F(a) {.f = (a)}
|
||||
#else
|
||||
#define CMD_F(a) {(a)}
|
||||
#endif
|
||||
|
||||
#define CMD_PTR(a) (uintptr_t)(a)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -139,4 +139,10 @@ extern GraphicsContext* __gfxCtx;
|
|||
(b) = _temp; \
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ALIGNED8 __attribute__ ((aligned (8)))
|
||||
#else
|
||||
#define ALIGNED8
|
||||
#endif
|
||||
|
||||
#endif // _MACROS_H_
|
||||
|
|
Loading…
Reference in New Issue