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:
Anghelo Carvajal 2021-11-04 20:36:02 -03:00 committed by GitHub
parent 418e09bf6f
commit fcb09f5e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -3,7 +3,7 @@
/** /**
* Command Base macros intended for use in designing of more specific command macros * 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)) #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_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 #endif

View File

@ -139,4 +139,10 @@ extern GraphicsContext* __gfxCtx;
(b) = _temp; \ (b) = _temp; \
} }
#ifdef __GNUC__
#define ALIGNED8 __attribute__ ((aligned (8)))
#else
#define ALIGNED8
#endif
#endif // _MACROS_H_ #endif // _MACROS_H_