diff --git a/include/gx2/utils.h b/include/gx2/utils.h new file mode 100644 index 0000000..649ec9d --- /dev/null +++ b/include/gx2/utils.h @@ -0,0 +1,31 @@ +#pragma once +#include + +/** + * \defgroup gx2_utils Utils + * \ingroup gx2 + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum GX2_SQ_SEL +{ + GX2_SQ_SEL_X = 0, + GX2_SQ_SEL_Y = 1, + GX2_SQ_SEL_Z = 2, + GX2_SQ_SEL_W = 3, + GX2_SQ_SEL_0 = 4, + GX2_SQ_SEL_1 = 5, + GX2_SQ_SEL_MASK = 7, +} GX2_SQ_SEL; + +#define GX2_SQ_SEL_MASK(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w)) + +#ifdef __cplusplus +} +#endif + +/** @} */ diff --git a/include/latte/latte_enum_sq.h b/include/latte/latte_enum_sq.h deleted file mode 100644 index a0f368f..0000000 --- a/include/latte/latte_enum_sq.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once -#include - -/** - * \defgroup latte_enum_sq Latte SQ Enums - * \ingroup latte - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum LATTE_SQ_SEL -{ - LATTE_SQ_SEL_X = 0, - LATTE_SQ_SEL_Y = 1, - LATTE_SQ_SEL_Z = 2, - LATTE_SQ_SEL_W = 3, - LATTE_SQ_SEL_0 = 4, - LATTE_SQ_SEL_1 = 5, - LATTE_SQ_SEL_MASK = 7, -} LATTE_SQ_SEL; - -#define LATTE_SQ_SEL_MASK(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w)) - -#ifdef __cplusplus -} -#endif - -/** @} */ diff --git a/libraries/libwhb/src/gfx_shader.c b/libraries/libwhb/src/gfx_shader.c index a3bfe18..659213f 100644 --- a/libraries/libwhb/src/gfx_shader.c +++ b/libraries/libwhb/src/gfx_shader.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -209,24 +209,24 @@ GfxGetAttribFormatSel(GX2AttribFormat format) case GX2_ATTRIB_FORMAT_SNORM_8: case GX2_ATTRIB_FORMAT_SINT_8: case GX2_ATTRIB_FORMAT_FLOAT_32: - return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1); + return GX2_SQ_SEL_MASK(GX2_SQ_SEL_X, GX2_SQ_SEL_0, GX2_SQ_SEL_0, GX2_SQ_SEL_1); case GX2_ATTRIB_FORMAT_UNORM_8_8: case GX2_ATTRIB_FORMAT_UINT_8_8: case GX2_ATTRIB_FORMAT_SNORM_8_8: case GX2_ATTRIB_FORMAT_SINT_8_8: case GX2_ATTRIB_FORMAT_FLOAT_32_32: - return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1); + return GX2_SQ_SEL_MASK(GX2_SQ_SEL_X, GX2_SQ_SEL_Y, GX2_SQ_SEL_0, GX2_SQ_SEL_1); case GX2_ATTRIB_FORMAT_FLOAT_32_32_32: - return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_Z, LATTE_SQ_SEL_1); + return GX2_SQ_SEL_MASK(GX2_SQ_SEL_X, GX2_SQ_SEL_Y, GX2_SQ_SEL_Z, GX2_SQ_SEL_1); case GX2_ATTRIB_FORMAT_UNORM_8_8_8_8: case GX2_ATTRIB_FORMAT_UINT_8_8_8_8: case GX2_ATTRIB_FORMAT_SNORM_8_8_8_8: case GX2_ATTRIB_FORMAT_SINT_8_8_8_8: case GX2_ATTRIB_FORMAT_FLOAT_32_32_32_32: - return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_Z, LATTE_SQ_SEL_W); + return GX2_SQ_SEL_MASK(GX2_SQ_SEL_X, GX2_SQ_SEL_Y, GX2_SQ_SEL_Z, GX2_SQ_SEL_W); break; default: - return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1); + return GX2_SQ_SEL_MASK(GX2_SQ_SEL_0, GX2_SQ_SEL_0, GX2_SQ_SEL_0, GX2_SQ_SEL_1); } }