Add missing latte_enum_sq.h header required by libwhb.

This commit is contained in:
James Benton 2017-05-10 17:48:48 +01:00
parent d307252772
commit 24c57e28c0
2 changed files with 36 additions and 7 deletions

View File

@ -0,0 +1,31 @@
#pragma once
#include <wut.h>
/**
* \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
/** @} */

View File

@ -150,8 +150,6 @@ WHBGfxLoadGFDShaderGroup(WHBGfxShaderGroup *group,
return TRUE;
}
#define SQ_SEL_MASK(x, y, z, w) (((x) << 24) | ((y) << 16) | ((z) << 8) | (w))
static uint32_t
GfxGetAttribFormatSel(GX2AttribFormat format)
{
@ -161,24 +159,24 @@ GfxGetAttribFormatSel(GX2AttribFormat format)
case GX2_ATTRIB_FORMAT_SNORM_8:
case GX2_ATTRIB_FORMAT_SINT_8:
case GX2_ATTRIB_FORMAT_FLOAT_32:
return SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1);
return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_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 SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1);
return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1);
case GX2_ATTRIB_FORMAT_FLOAT_32_32_32:
return SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_Z, LATTE_SQ_SEL_1);
return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_Z, LATTE_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 SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_Z, LATTE_SQ_SEL_W);
return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_X, LATTE_SQ_SEL_Y, LATTE_SQ_SEL_Z, LATTE_SQ_SEL_W);
break;
default:
return SQ_SEL_MASK(LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1);
return LATTE_SQ_SEL_MASK(LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_0, LATTE_SQ_SEL_1);
}
}