Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // gx2Enum.h
- //
- // Declares enums for gx2 library.
- #ifndef _CAFE_GX2_ENUM_H_
- #define _CAFE_GX2_ENUM_H_
- #ifdef __cplusplus
- extern "C"
- {
- #endif // __cplusplus
- #if defined _WIN32 || defined _WIN64
- #include <assert.h>
- #include <string.h>
- #ifndef ASSERT
- #define ASSERT assert
- #endif // ASSERT
- #ifndef GX2_INLINE
- #define GX2_INLINE inline
- #endif // GX2_INLINE
- #else
- #ifndef GX2_INLINE
- #define GX2_INLINE static inline
- #endif // GX2_INLINE
- #endif // _WIN32 || defined _WIN64
- // This define is used as a tag to mark function prototypes that
- // are exported from gx2.rpl.
- #define GX2API
- #define GX2_CHECK_ENUM_RANGE(value, type) \
- ASSERT(value>=type##_FIRST && value<=type##_LAST);
- /*
- * These are aliases for the MOV enums which are deprecated
- */
- #define GX2MOVMode GX2DRCMode
- #define GX2_MOV_NONE GX2_DRC_NONE
- #define GX2_MOV_SINGLE GX2_DRC_SINGLE
- #define GX2_MOV_DOUBLE GX2_DRC_DOUBLE
- #define GX2_MOV_FIRST GX2_DRC_FIRST
- #define GX2_MOV_LAST GX2_DRC_LAST
- #define GX2_SCAN_TARGET_MOV_FIRST GX2_SCAN_TARGET_DRC_FIRST
- #define GX2_SCAN_TARGET_MOV_SECOND GX2_SCAN_TARGET_DRC_SECOND
- /// @addtogroup GX2EnumGroup
- /// @{
- // -----------------------------------------------------------------------------
- // Enums - general
- /// \brief GX2's version of bool-type values.
- ///
- typedef enum _GX2Boolean
- {
- GX2_FALSE = 0,
- GX2_TRUE = 1,
- GX2_DISABLE = 0,
- GX2_ENABLE = 1
- } GX2Boolean;
- /// \brief GX2's initialize attributes
- ///
- typedef enum _GX2InitAttrib {
- GX2_INIT_ATTRIB_NULL, ///< list terminator
- GX2_INIT_ATTRIB_CB_BASE, ///< command buffer pool base address
- GX2_INIT_ATTRIB_CB_SIZE, ///< command buffer pool size
- GX2_INIT_ATTRIB_UDA_LEVEL, ///< (Temporary Placeholder) set uda alert level
- GX2_INIT_ATTRIB_UDA_TESTMODE, ///< (Temporary Placeholder) enable uda test mode
- GX2_INIT_ATTRIB_UDA_DISABLE_ALERT, ///< (Temporary Placeholder) disable specific uda alert
- GX2_INIT_ATTRIB_UDA_MAXFIRECOUNT, ///< (Temporary Placeholder) max number of times an alert will be reported
- GX2_INIT_ATTRIB_ARGC, ///< argc from main()
- GX2_INIT_ATTRIB_ARGV, ///< argv from main()
- GX2_INIT_ATTRIB_PROFILE_MODE, ///< Profiling mode
- GX2_INIT_ATTRIB_TOSS_STAGE, ///< Toss stage
- GX2_INIT_ATTRIB_LAST = GX2_INIT_ATTRIB_TOSS_STAGE
- } GX2InitAttrib;
- // -----------------------------------------------------------------------------
- // Enums - Render State
- /// \brief Describes the vertex order of front-facing polygons.
- ///
- typedef enum _GX2FrontFaceMode
- {
- GX2_FRONT_FACE_CCW = 0,
- GX2_FRONT_FACE_CW = 1,
- GX2_FRONT_FACE_FIRST = GX2_FRONT_FACE_CCW,
- GX2_FRONT_FACE_LAST = GX2_FRONT_FACE_CW
- } GX2FrontFaceMode;
- /// \brief When dual-sided polygon mode is enabled, describes the
- /// base primitive used to draw each side of the polygon.
- ///
- typedef enum _GX2PolygonMode
- {
- GX2_POLYGON_MODE_POINT = 0,
- GX2_POLYGON_MODE_LINE = 1,
- GX2_POLYGON_MODE_TRIANGLE = 2,
- GX2_POLYGON_MODE_FIRST = GX2_POLYGON_MODE_POINT,
- GX2_POLYGON_MODE_LAST = GX2_POLYGON_MODE_TRIANGLE
- } GX2PolygonMode;
- /// \brief Compare function used for depth & stencil tests.
- ///
- typedef enum _GX2CompareFunction
- {
- GX2_COMPARE_NEVER = 0,
- GX2_COMPARE_LESS = 1,
- GX2_COMPARE_EQUAL = 2,
- GX2_COMPARE_LEQUAL = 3,
- GX2_COMPARE_GREATER = 4,
- GX2_COMPARE_NOTEQUAL = 5,
- GX2_COMPARE_GEQUAL = 6,
- GX2_COMPARE_ALWAYS = 7,
- GX2_COMPARE_FIRST = GX2_COMPARE_NEVER,
- GX2_COMPARE_LAST = GX2_COMPARE_ALWAYS
- } GX2CompareFunction;
- /// \brief Stencil function to be performed if stencil tests pass.
- ///
- typedef enum _GX2StencilFunction
- {
- GX2_STENCIL_KEEP = 0,
- GX2_STENCIL_ZERO = 1,
- GX2_STENCIL_REPLACE = 2,
- GX2_STENCIL_INCR = 3,
- GX2_STENCIL_DECR = 4,
- GX2_STENCIL_INVERT = 5,
- GX2_STENCIL_INCR_WRAP = 6,
- GX2_STENCIL_DECR_WRAP = 7,
- GX2_STENCIL_FIRST = GX2_STENCIL_KEEP,
- GX2_STENCIL_LAST = GX2_STENCIL_DECR_WRAP
- } GX2StencilFunction;
- /// \brief RGBA color channel mask values.
- ///
- typedef enum _GX2ChannelMask
- {
- GX2_CHANNEL_MASK_NONE = 0x0, ///< 0000
- GX2_CHANNEL_MASK_R = 0x1, ///< 0001
- GX2_CHANNEL_MASK_G = 0x2, ///< 0010
- GX2_CHANNEL_MASK_RG = 0x3, ///< 0011
- GX2_CHANNEL_MASK_B = 0x4, ///< 0100
- GX2_CHANNEL_MASK_RB = 0x5, ///< 0101
- GX2_CHANNEL_MASK_GB = 0x6, ///< 0110
- GX2_CHANNEL_MASK_RGB = 0x7, ///< 0111
- GX2_CHANNEL_MASK_A = 0x8, ///< 1000
- GX2_CHANNEL_MASK_RA = 0x9, ///< 1001
- GX2_CHANNEL_MASK_GA = 0xA, ///< 1010
- GX2_CHANNEL_MASK_RGA = 0xB, ///< 1011
- GX2_CHANNEL_MASK_BA = 0xC, ///< 1100
- GX2_CHANNEL_MASK_RBA = 0xD, ///< 1101
- GX2_CHANNEL_MASK_GBA = 0xE, ///< 1110
- GX2_CHANNEL_MASK_RGBA = 0xF, ///< 1111
- GX2_CHANNEL_MASK_FIRST = GX2_CHANNEL_MASK_NONE,
- GX2_CHANNEL_MASK_LAST = GX2_CHANNEL_MASK_RGBA
- } GX2ChannelMask;
- /// \brief Describes the logic op function to perform.
- ///
- /// \note Always specify GX2_LOGIC_OP_COPY when logic op is not used.
- ///
- typedef enum _GX2LogicOp
- {
- GX2_LOGIC_OP_CLEAR = 0x00, ///< 0x00 (BLACKNESS)
- GX2_LOGIC_OP_SET = 0xFF, ///< 0xff (WHITNESS)
- GX2_LOGIC_OP_COPY = 0xCC, ///< Source (Default)
- GX2_LOGIC_OP_INVCOPY = 0x33, ///< ~Source
- GX2_LOGIC_OP_NOOP = 0xAA, ///< Destination
- GX2_LOGIC_OP_INV = 0x55, ///< ~Destination
- GX2_LOGIC_OP_AND = 0x88, ///< Source & Destination
- GX2_LOGIC_OP_NAND = 0x77, ///< ~(Source & Destination)
- GX2_LOGIC_OP_OR = 0xEE, ///< Source | Destination
- GX2_LOGIC_OP_NOR = 0x11, ///< ~(Source | Destination)
- GX2_LOGIC_OP_XOR = 0x66, ///< Source ^ Destination
- GX2_LOGIC_OP_EQUIV = 0x99, ///< ~(Source ^ Destination)
- GX2_LOGIC_OP_REVAND = 0x44, ///< Source & ~Destination
- GX2_LOGIC_OP_INVAND = 0x22, ///< ~Source & Destination
- GX2_LOGIC_OP_REVOR = 0xDD, ///< Source | ~Destination
- GX2_LOGIC_OP_INVOR = 0xBB, ///< ~Source | Destination
- GX2_LOGIC_OP_NONE = GX2_LOGIC_OP_COPY, ///< Useful synonym
- GX2_LOGIC_OP_FIRST = GX2_LOGIC_OP_CLEAR,
- GX2_LOGIC_OP_LAST = GX2_LOGIC_OP_SET
- } GX2LogicOp;
- /// \brief Describes the factors used in the blend function.
- ///
- /// In the descriptions below, the first column describes color blend
- /// functions, while the second column describes alpha blend functions.
- /// The codes are:
- /// - s0 = source 0
- /// - s1 = source 1 (see note below)
- /// - d = destination
- /// - c = constant
- /// - f = min(s0:A, 1-d:A).
- ///
- /// \note Using source 1 implies dual-source blending. This is
- /// mutually exclusive with MRTs. It is also not compatible
- /// with multiwriteEnable (\ref GX2SetColorControl).
- /// It requires a pixel shader with 2 color output channels
- /// (gl_FragData[0] and gl_FragData[1]).
- ///
- typedef enum _GX2BlendFunction
- {
- GX2_BLEND_ZERO = 0, ///< (0,0,0) | (0)
- GX2_BLEND_ONE = 1, ///< (1,1,1) | (1)
- GX2_BLEND_SRC_COLOR = 2, ///< s0:(R,G,B) | s0:(A)
- GX2_BLEND_ONE_MINUS_SRC_COLOR = 3, ///< s0:(1-R,1-G,1-B) | s0:(1-A)
- GX2_BLEND_SRC_ALPHA = 4, ///< s0:(A,A,A) | s0:(A)
- GX2_BLEND_ONE_MINUS_SRC_ALPHA = 5, ///< s0:(1-A,1-A,1-A) | s0:(1-A)
- GX2_BLEND_DST_ALPHA = 6, ///< d :(A,A,A) | d :(A)
- GX2_BLEND_ONE_MINUS_DST_ALPHA = 7, ///< d :(1-A,1-A,1-A) | d :(1-A)
- GX2_BLEND_DST_COLOR = 8, ///< d :(R,G,B) | d :(A)
- GX2_BLEND_ONE_MINUS_DST_COLOR = 9, ///< d :(1-R,1-G,1-B) | d :(1-A)
- GX2_BLEND_SRC_ALPHA_SATURATE = 10, ///< (f,f,f) | (1)
- GX2_BLEND_CONSTANT_COLOR = 13, ///< c :(R,G,B) | c :(A)
- GX2_BLEND_ONE_MINUS_CONSTANT_COLOR = 14, ///< c :(1-R,1-G,1-B) | c :(1-A)
- GX2_BLEND_SRC1_COLOR = 15, ///< s1:(R,G,B) | s1:(A)
- GX2_BLEND_ONE_MINUS_SRC1_COLOR = 16, ///< s1:(1-R,1-G,1-B) | s1:(1-A)
- GX2_BLEND_SRC1_ALPHA = 17, ///< s1:(A,A,A) | s1:(A)
- GX2_BLEND_ONE_MINUS_SRC1_ALPHA = 18, ///< s1:(1-A,1-A,1-A) | s1:(1-A)
- GX2_BLEND_CONSTANT_ALPHA = 19, ///< c :(A,A,A) | c :(A)
- GX2_BLEND_ONE_MINUS_CONSTANT_ALPHA = 20, ///< c :(1-A,1-A,1-A) | c :(1-A)
- GX2_BLEND_FIRST = GX2_BLEND_ZERO,
- GX2_BLEND_LAST = GX2_BLEND_ONE_MINUS_CONSTANT_ALPHA
- } GX2BlendFunction;
- /// \brief Describes how the terms of the blend function are combined.
- ///
- typedef enum _GX2BlendCombine
- {
- GX2_BLEND_COMBINE_ADD = 0,
- GX2_BLEND_COMBINE_SRC_MINUS_DST = 1,
- GX2_BLEND_COMBINE_MIN = 2,
- GX2_BLEND_COMBINE_MAX = 3,
- GX2_BLEND_COMBINE_DST_MINUS_SRC = 4,
- GX2_BLEND_COMBINE_FIRST = GX2_BLEND_COMBINE_ADD,
- GX2_BLEND_COMBINE_LAST = GX2_BLEND_COMBINE_DST_MINUS_SRC
- } GX2BlendCombine;
- /// \brief Used to tweak the AlphaToMask operation.
- ///
- typedef enum _GX2AlphaToMaskMode
- {
- GX2_ALPHA_TO_MASK_0 = 0, ///< non-dithered
- GX2_ALPHA_TO_MASK_1 = 1, ///< dithered, rotation 0
- GX2_ALPHA_TO_MASK_2 = 2, ///< dithered, rotation 90
- GX2_ALPHA_TO_MASK_3 = 3, ///< dithered, rotation 180
- GX2_ALPHA_TO_MASK_4 = 4, ///< dithered, rotation 270
- GX2_ALPHA_TO_MASK_FIRST = GX2_ALPHA_TO_MASK_0,
- GX2_ALPHA_TO_MASK_LAST = GX2_ALPHA_TO_MASK_4
- } GX2AlphaToMaskMode;
- /// \brief Used to specify a destination render target.
- ///
- typedef enum _GX2RenderTarget
- {
- GX2_RENDER_TARGET_0 = 0,
- GX2_RENDER_TARGET_1 = 1,
- GX2_RENDER_TARGET_2 = 2,
- GX2_RENDER_TARGET_3 = 3,
- GX2_RENDER_TARGET_4 = 4,
- GX2_RENDER_TARGET_5 = 5,
- GX2_RENDER_TARGET_6 = 6,
- GX2_RENDER_TARGET_7 = 7,
- GX2_RENDER_TARGET_FIRST = GX2_RENDER_TARGET_0,
- GX2_RENDER_TARGET_LAST = GX2_RENDER_TARGET_7
- } GX2RenderTarget;
- // -----------------------------------------------------------------------------
- // Enums - Vertex Streams
- /// \brief Describes the overall format of a vertex attribute entry.
- ///
- /// Please refer to \ref GX2FormatPage for more details.
- ///
- /// Type conversion options:
- /// - UNORM : attrib unsigned integer is converted to/from [0.0, 1.0] in shader
- /// - UINT : attrib unsigned integer is copied to/from shader as unsigned int
- /// - SNORM : attrib signed integer is converted to/from [-1.0, 1.0] in shader
- /// - SINT : attrib signed integer is copied to/from shader as signed int
- /// - FLOAT : attrib float is copied to/from shader as float
- /// - UINT_TO_FLOAT : attrib unsigned integer is converted float in shader
- /// - SINT_TO_FLOAT : attrib signed integer is converted float in shader
- /// (32 bit integers cannot be converted to float during fetch)
- typedef enum _GX2AttribFormat
- {
- // 8 bits (8 x 1):
- GX2_ATTRIB_FORMAT_8_UNORM = 0x00000000,
- GX2_ATTRIB_FORMAT_8_UINT = 0x00000100,
- GX2_ATTRIB_FORMAT_8_SNORM = 0x00000200,
- GX2_ATTRIB_FORMAT_8_SINT = 0x00000300,
- GX2_ATTRIB_FORMAT_8_UINT_TO_FLOAT = 0x00000800,
- GX2_ATTRIB_FORMAT_8_SINT_TO_FLOAT = 0x00000a00,
- // 8 bits (4 x 2):
- GX2_ATTRIB_FORMAT_4_4_UNORM = 0x00000001,
- // 16 bits (16 x 1):
- GX2_ATTRIB_FORMAT_16_UNORM = 0x00000002,
- GX2_ATTRIB_FORMAT_16_UINT = 0x00000102,
- GX2_ATTRIB_FORMAT_16_SNORM = 0x00000202,
- GX2_ATTRIB_FORMAT_16_SINT = 0x00000302,
- GX2_ATTRIB_FORMAT_16_FLOAT = 0x00000803,
- GX2_ATTRIB_FORMAT_16_UINT_TO_FLOAT = 0x00000802,
- GX2_ATTRIB_FORMAT_16_SINT_TO_FLOAT = 0x00000a02,
- // 16 bits (8 x 2):
- GX2_ATTRIB_FORMAT_8_8_UNORM = 0x00000004,
- GX2_ATTRIB_FORMAT_8_8_UINT = 0x00000104,
- GX2_ATTRIB_FORMAT_8_8_SNORM = 0x00000204,
- GX2_ATTRIB_FORMAT_8_8_SINT = 0x00000304,
- GX2_ATTRIB_FORMAT_8_8_UINT_TO_FLOAT = 0x00000804,
- GX2_ATTRIB_FORMAT_8_8_SINT_TO_FLOAT = 0x00000a04,
- // 32 bits (32 x 1):
- GX2_ATTRIB_FORMAT_32_UINT = 0x00000105,
- GX2_ATTRIB_FORMAT_32_SINT = 0x00000305,
- GX2_ATTRIB_FORMAT_32_FLOAT = 0x00000806,
- // 32 bits (16 x 2):
- GX2_ATTRIB_FORMAT_16_16_UNORM = 0x00000007,
- GX2_ATTRIB_FORMAT_16_16_UINT = 0x00000107,
- GX2_ATTRIB_FORMAT_16_16_SNORM = 0x00000207,
- GX2_ATTRIB_FORMAT_16_16_SINT = 0x00000307,
- GX2_ATTRIB_FORMAT_16_16_FLOAT = 0x00000808,
- GX2_ATTRIB_FORMAT_16_16_UINT_TO_FLOAT = 0x00000807,
- GX2_ATTRIB_FORMAT_16_16_SINT_TO_FLOAT = 0x00000a07,
- // 32 bits (10/11 x 3):
- GX2_ATTRIB_FORMAT_10_11_11_FLOAT = 0x00000809,
- // 32 bits (8 x 4):
- GX2_ATTRIB_FORMAT_8_8_8_8_UNORM = 0x0000000a,
- GX2_ATTRIB_FORMAT_8_8_8_8_UINT = 0x0000010a,
- GX2_ATTRIB_FORMAT_8_8_8_8_SNORM = 0x0000020a,
- GX2_ATTRIB_FORMAT_8_8_8_8_SINT = 0x0000030a,
- GX2_ATTRIB_FORMAT_8_8_8_8_UINT_TO_FLOAT = 0x0000080a,
- GX2_ATTRIB_FORMAT_8_8_8_8_SINT_TO_FLOAT = 0x00000a0a,
- // 32 bits (10 x 3 + 2):
- GX2_ATTRIB_FORMAT_10_10_10_2_UNORM = 0x0000000b,
- GX2_ATTRIB_FORMAT_10_10_10_2_UINT = 0x0000010b,
- GX2_ATTRIB_FORMAT_10_10_10_2_SNORM = 0x0000020b, // "2" part is UNORM
- GX2_ATTRIB_FORMAT_10_10_10_2_SINT = 0x0000030b,
- // 64 bits (32 x 2):
- GX2_ATTRIB_FORMAT_32_32_UINT = 0x0000010c,
- GX2_ATTRIB_FORMAT_32_32_SINT = 0x0000030c,
- GX2_ATTRIB_FORMAT_32_32_FLOAT = 0x0000080d,
- // 64 bits (16 x 4):
- GX2_ATTRIB_FORMAT_16_16_16_16_UNORM = 0x0000000e,
- GX2_ATTRIB_FORMAT_16_16_16_16_UINT = 0x0000010e,
- GX2_ATTRIB_FORMAT_16_16_16_16_SNORM = 0x0000020e,
- GX2_ATTRIB_FORMAT_16_16_16_16_SINT = 0x0000030e,
- GX2_ATTRIB_FORMAT_16_16_16_16_FLOAT = 0x0000080f,
- GX2_ATTRIB_FORMAT_16_16_16_16_UINT_TO_FLOAT = 0x0000080e,
- GX2_ATTRIB_FORMAT_16_16_16_16_SINT_TO_FLOAT = 0x00000a0e,
- // 96 bits (32 x 3):
- GX2_ATTRIB_FORMAT_32_32_32_UINT = 0x00000110,
- GX2_ATTRIB_FORMAT_32_32_32_SINT = 0x00000310,
- GX2_ATTRIB_FORMAT_32_32_32_FLOAT = 0x00000811,
- // 128 bits (32 x 4):
- GX2_ATTRIB_FORMAT_32_32_32_32_UINT = 0x00000112,
- GX2_ATTRIB_FORMAT_32_32_32_32_SINT = 0x00000312,
- GX2_ATTRIB_FORMAT_32_32_32_32_FLOAT = 0x00000813,
- //
- GX2_ATTRIB_FORMAT_FIRST = GX2_ATTRIB_FORMAT_8_UNORM,
- GX2_ATTRIB_FORMAT_LAST = GX2_ATTRIB_FORMAT_16_16_16_16_SINT_TO_FLOAT
- } GX2AttribFormat;
- /// \brief Describes the index used to look up vertex attributes.
- ///
- typedef enum _GX2AttribIndexType
- {
- /// per-vertex index
- GX2_ATTRIB_INDEX_VERTEX_ID = 0x00000000,
- /// per-instance index
- GX2_ATTRIB_INDEX_INSTANCE_ID = 0x00000001,
- GX2_ATTRIB_INDEX_FIRST = GX2_ATTRIB_INDEX_VERTEX_ID,
- GX2_ATTRIB_INDEX_LAST = GX2_ATTRIB_INDEX_INSTANCE_ID
- } GX2AttribIndexType;
- /// \brief Used to control attribute and texture component swizzling
- /// as well as specifying values for elements not present in the format.
- ///
- typedef enum _GX2Component
- {
- GX2_COMPONENT_X_R = 0x00000000, // X or red
- GX2_COMPONENT_Y_G = 0x00000001, // Y or green
- GX2_COMPONENT_Z_B = 0x00000002, // Z or blue
- GX2_COMPONENT_W_A = 0x00000003, // W or alpha
- GX2_COMPONENT_C_0 = 0x00000004, // constant 0
- GX2_COMPONENT_C_1 = 0x00000005, // constant 1
- GX2_COMPONENT_FIRST = GX2_COMPONENT_X_R,
- GX2_COMPONENT_LAST = GX2_COMPONENT_C_1
- } GX2Component;
- // -----------------------------------------------------------------------------
- // Enums - Shaders
- /// \brief Used to indicate the desired shader mode of operation
- ///
- /// \note: Changing the mode invokes a full pipeline flush (affects performance)
- /// \note: GX2_SHADER_MODE_GEOMETRY_SHADER - Enable full geometry shader support.
- /// When this mode is enabled UNIFORM_BLOCKS will automatically be enabled.
- typedef enum _GX2ShaderMode
- {
- GX2_SHADER_MODE_UNIFORM_REGISTER,
- GX2_SHADER_MODE_UNIFORM_BLOCK,
- GX2_SHADER_MODE_GEOMETRY_SHADER,
- GX2_SHADER_MODE_FIRST = GX2_SHADER_MODE_UNIFORM_REGISTER,
- GX2_SHADER_MODE_LAST = GX2_SHADER_MODE_GEOMETRY_SHADER
- } GX2ShaderMode;
- /// \brief Type for shader variables (attribs, uniforms, etc.)
- ///
- typedef enum _GX2VarType
- {
- GX2_VAR_TYPE_VOID,
- GX2_VAR_TYPE_BOOL,
- GX2_VAR_TYPE_INT,
- GX2_VAR_TYPE_UINT,
- GX2_VAR_TYPE_FLOAT,
- GX2_VAR_TYPE_DOUBLE,
- GX2_VAR_TYPE_DVEC2,
- GX2_VAR_TYPE_DVEC3,
- GX2_VAR_TYPE_DVEC4,
- GX2_VAR_TYPE_VEC2,
- GX2_VAR_TYPE_VEC3,
- GX2_VAR_TYPE_VEC4,
- GX2_VAR_TYPE_BVEC2,
- GX2_VAR_TYPE_BVEC3,
- GX2_VAR_TYPE_BVEC4,
- GX2_VAR_TYPE_IVEC2,
- GX2_VAR_TYPE_IVEC3,
- GX2_VAR_TYPE_IVEC4,
- GX2_VAR_TYPE_UVEC2,
- GX2_VAR_TYPE_UVEC3,
- GX2_VAR_TYPE_UVEC4,
- GX2_VAR_TYPE_MAT2,
- GX2_VAR_TYPE_MAT2X3,
- GX2_VAR_TYPE_MAT2X4,
- GX2_VAR_TYPE_MAT3X2,
- GX2_VAR_TYPE_MAT3,
- GX2_VAR_TYPE_MAT3X4,
- GX2_VAR_TYPE_MAT4X2,
- GX2_VAR_TYPE_MAT4X3,
- GX2_VAR_TYPE_MAT4,
- GX2_VAR_TYPE_DMAT2,
- GX2_VAR_TYPE_DMAT2X3,
- GX2_VAR_TYPE_DMAT2X4,
- GX2_VAR_TYPE_DMAT3X2,
- GX2_VAR_TYPE_DMAT3,
- GX2_VAR_TYPE_DMAT3X4,
- GX2_VAR_TYPE_DMAT4X2,
- GX2_VAR_TYPE_DMAT4X3,
- GX2_VAR_TYPE_DMAT4,
- GX2_VAR_TYPE_FIRST = GX2_VAR_TYPE_VOID,
- GX2_VAR_TYPE_LAST = GX2_VAR_TYPE_DMAT4
- } GX2VarType;
- /// \brief Type for shader samplers.
- /// If it's not "INT", then it's float.
- ///
- /// This can be used for verification.
- /// It can also indicate when to set depth-sampling filter option.
- ///
- typedef enum _GX2SamplerType
- {
- GX2_SAMPLER_TYPE_1D,
- GX2_SAMPLER_TYPE_2D,
- GX2_SAMPLER_TYPE_2D_RECT,
- GX2_SAMPLER_TYPE_3D,
- GX2_SAMPLER_TYPE_CUBE,
- GX2_SAMPLER_TYPE_1D_SHADOW,
- GX2_SAMPLER_TYPE_2D_SHADOW,
- GX2_SAMPLER_TYPE_2D_RECT_SHADOW,
- GX2_SAMPLER_TYPE_CUBE_SHADOW,
- GX2_SAMPLER_TYPE_1D_ARRAY,
- GX2_SAMPLER_TYPE_2D_ARRAY,
- GX2_SAMPLER_TYPE_1D_ARRAY_SHADOW,
- GX2_SAMPLER_TYPE_2D_ARRAY_SHADOW,
- GX2_SAMPLER_TYPE_CUBE_ARRAY,
- GX2_SAMPLER_TYPE_CUBE_ARRAY_SHADOW,
- GX2_SAMPLER_TYPE_BUFFER,
- GX2_SAMPLER_TYPE_RESERVED_1,
- GX2_SAMPLER_TYPE_2D_MS,
- GX2_SAMPLER_TYPE_2D_MS_ARRAY,
- GX2_SAMPLER_TYPE_INT_1D,
- GX2_SAMPLER_TYPE_INT_2D,
- GX2_SAMPLER_TYPE_INT_2D_RECT,
- GX2_SAMPLER_TYPE_INT_3D,
- GX2_SAMPLER_TYPE_INT_CUBE,
- GX2_SAMPLER_TYPE_INT_1D_ARRAY,
- GX2_SAMPLER_TYPE_INT_2D_ARRAY,
- GX2_SAMPLER_TYPE_INT_CUBE_ARRAY,
- GX2_SAMPLER_TYPE_INT_BUFFER,
- GX2_SAMPLER_TYPE_RESERVED_2,
- GX2_SAMPLER_TYPE_INT_2D_MS,
- GX2_SAMPLER_TYPE_INT_2D_MS_ARRAY,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_1D,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_2D,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_2D_RECT,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_3D,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_CUBE,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_1D_ARRAY,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_2D_ARRAY,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_CUBE_ARRAY,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_BUFFER,
- GX2_SAMPLER_TYPE_RESERVED_3,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_2D_MS,
- GX2_SAMPLER_TYPE_UNSIGNED_INT_2D_MS_ARRAY,
- GX2_SAMPLER_TYPE_FIRST = GX2_SAMPLER_TYPE_1D,
- GX2_SAMPLER_TYPE_LAST = GX2_SAMPLER_TYPE_UNSIGNED_INT_2D_MS_ARRAY
- } GX2SamplerType;
- // -----------------------------------------------------------------------------
- // Enums - Drawing
- /// \brief Indicates whether vertex indices are 16-bit or 32-bit.
- ///
- typedef enum _GX2IndexFormat
- {
- GX2_INDEX_FORMAT_U16_LE = 0, // indices are u16, little-endian
- GX2_INDEX_FORMAT_U32_LE = 1, // indices are u32, little-endian
- GX2_INDEX_FORMAT_U16 = 4, // indices are u16, big-endian
- GX2_INDEX_FORMAT_U32 = 9, // indices are u32, big-endian
- GX2_INDEX_FORMAT_FIRST = GX2_INDEX_FORMAT_U16_LE,
- GX2_INDEX_FORMAT_LAST = GX2_INDEX_FORMAT_U32
- } GX2IndexFormat;
- /// \brief Indicates type of primitive to draw.
- ///
- /// Below, "min" is the minimum number of vertices to draw a single primitive.
- /// The "incr" is how many more vertices are needed to draw the next primitive.
- ///
- typedef enum _GX2PrimitiveType
- {
- GX2_PRIMITIVE_POINTS = 0x01, ///< min = 1; incr = 1
- GX2_PRIMITIVE_LINES = 0x02, ///< min = 2; incr = 2
- GX2_PRIMITIVE_LINE_STRIP = 0x03, ///< min = 2; incr = 1
- GX2_PRIMITIVE_TRIANGLES = 0x04, ///< min = 3; incr = 3
- GX2_PRIMITIVE_TRIANGLE_FAN = 0x05, ///< min = 3; incr = 1
- GX2_PRIMITIVE_TRIANGLE_STRIP = 0x06, ///< min = 3; incr = 1
- GX2_PRIMITIVE_LINES_ADJACENCY = 0x0a, ///< min = 4; incr = 4
- GX2_PRIMITIVE_LINE_STRIP_ADJACENCY = 0x0b, ///< min = 4; incr = 1
- GX2_PRIMITIVE_TRIANGLES_ADJACENCY = 0x0c, ///< min = 6; incr = 6
- GX2_PRIMITIVE_TRIANGLE_STRIP_ADJACENCY = 0x0d, ///< min = 6; incr = 2
- GX2_PRIMITIVE_RECTS = 0x11, ///< min = 3; incr = 3
- GX2_PRIMITIVE_LINE_LOOP = 0x12, ///< min = 2; incr = 1
- GX2_PRIMITIVE_QUADS = 0x13, ///< min = 4; incr = 4
- GX2_PRIMITIVE_QUAD_STRIP = 0x14, ///< min = 4; incr = 2
- GX2_PRIMITIVE_TESSELLATE_LINES = 0x82, ///< min = 2; incr = 2
- GX2_PRIMITIVE_TESSELLATE_LINE_STRIP = 0x83, ///< min = 2; incr = 1
- GX2_PRIMITIVE_TESSELLATE_TRIANGLES = 0x84, ///< min = 3; incr = 3
- GX2_PRIMITIVE_TESSELLATE_TRIANGLE_STRIP = 0x86, ///< min = 3; incr = 1
- GX2_PRIMITIVE_TESSELLATE_QUADS = 0x93, ///< min = 4; incr = 4
- GX2_PRIMITIVE_TESSELLATE_QUAD_STRIP = 0x94, ///< min = 4; incr = 2
- GX2_PRIMITIVE_FIRST = GX2_PRIMITIVE_POINTS,
- GX2_PRIMITIVE_LAST = GX2_PRIMITIVE_TESSELLATE_QUAD_STRIP
- } GX2PrimitiveType;
- // -----------------------------------------------------------------------------
- // Enums - Clear
- /// \brief Describes which buffers to clear for depth/stencil clear
- ///
- typedef enum _GX2ClearMode
- {
- GX2_CLEAR_NONE = 0, // No-op
- GX2_CLEAR_DEPTH = 1, // clear depth buffer
- GX2_CLEAR_STENCIL = 2, // clear stencil buffer
- GX2_CLEAR_D_REG = 4, // Set depth clear value into the current context
- // register. The depth buffer values are not actually
- // changed. This register value needs to match the
- // clear value of the buffer for correct HiZ operation.
- GX2_CLEAR_S_REG = 8, // Set stencil clear value into the current context
- // register. The stencil buffer values are not
- // actually changed. This register value needs to
- // match clear value of the buffer for correct HiZ
- // operation.
- GX2_CLEAR_BOTH = GX2_CLEAR_DEPTH | GX2_CLEAR_STENCIL,
- GX2_CLEAR_D_S_REG = GX2_CLEAR_D_REG | GX2_CLEAR_S_REG,
- GX2_CLEAR_DEPTH_D_REG = GX2_CLEAR_DEPTH | GX2_CLEAR_D_REG,
- GX2_CLEAR_STENCIL_S_REG = GX2_CLEAR_STENCIL | GX2_CLEAR_S_REG,
- GX2_CLEAR_BOTH_D_S_REG = GX2_CLEAR_DEPTH_D_REG | GX2_CLEAR_STENCIL_S_REG,
- GX2_CLEAR_FIRST = GX2_CLEAR_NONE,
- GX2_CLEAR_LAST = GX2_CLEAR_BOTH_D_S_REG
- } GX2ClearMode;
- // -----------------------------------------------------------------------------
- // Enums - Textures & other surfaces
- /// \brief Indicates desired texture, color-buffer, depth-buffer, or scan-buffer format.
- ///
- /// After the word "format", the following letters indicate the possible uses:
- /// T=texture, C=color-buffer, D=depth/stencil-buffer, S=scan-buffer.
- ///
- /// There are some formats with the same enum value, but different use labels.
- /// These are provided as a convenience to explain the type information for each use.
- ///
- /// Type conversion options:
- /// - UNORM (0): surface unsigned integer is converted to/from [0.0, 1.0] in shader
- /// - UINT (1): surface unsigned integer is copied to/from shader as unsigned int
- /// - SNORM (2): surface signed integer is converted to/from [-1.0, 1.0] in shader
- /// - SINT (3): surface signed integer is copied to/from shader as signed int
- /// - SRGB (4): SRGB degamma performed on surface read, then treated as UNORM;
- /// SRGB gamma is performed on surface write
- /// - FLOAT (8): surface float is copied to/from shader as float
- ///
- /// Note: As textures, all UINT/SINT formats may be point-sampled only!
- ///
- /// The numbers in the names indicate the number of bits per channel, as well as
- /// how many channels are present. An "X" in front of a number indicates padding
- /// bits that are present, but do not map to any channel.
- ///
- /// Texture color channel mappings:
- /// - 1-channel formats map to R [GBA are undefined]
- /// - 2-channel formats map to RG [BA are undefined]
- /// - 3-channel formats map to RGB [A is undefined]
- /// - 4-channel formats map to RGBA
- ///
- /// Channel mapping can be changed using the GX2InitTextureCompSel API.
- /// We advise you avoid referring to channels that don't exist in the format.
- /// You should use the component select to choose constant values in those cases.
- /// The default component selectors in GX2InitTexture map:
- /// - 1-channel formats to R001
- /// - 2-channel formats to RG01
- /// - 3-channel formats to RGB1
- /// - 4-channel formats to RGBA
- ///
- /// To understand exact component bit placement, you must first understand the
- /// basic machine unit that the components are packed into. If each component
- /// fits into a single unit, then the order is simply R,G,B,A. If multiple
- /// components are packed into a single unit, then the components are packed
- /// in order starting from the LSB end. In all cases, multi-byte machine units
- /// are then written out in little-endian format.
- ///
- /// Note 1: It is not presently possible to switch between depth and color buffer
- /// uses for the same surface. This requires a retiling, since the tile formats
- /// are different and incompatible. The texture unit can read depth-tiled buffers
- /// (except for D24_S8 format). The D24_S8 format requires tile-conversion before
- /// it can be read by the texture unit. Note that the two components have different
- /// number formats, and only the depth part can be sampled with any filter more
- /// complex than point-sampling.
- /// It is needed to use GX2_SURFACE_FORMAT_T_R24_UNORM_X8 for reading depth buffer as
- /// texture and GX2_SURFACE_FORMAT_T_X24_G8_UINT for reading stencil buffer as texture.
- /// See \ref GX2ConvertDepthBufferToTextureSurface() for more information.
- ///
- /// Note 2: Similar to depth format D_D24_S8_UNORM and texture formats T_R24_UNORM_X8
- /// and T_X24_G8_UINT, format GX2_SURFACE_FORMAT_D_D32_FLOAT_S8_UINT_X24 is a
- /// depth/stencil buffer format while T_R32_FLOAT_X8_X24 and T_X32_G8_UINT_X24 are
- /// texture formats used to read the depth and stencil data, respectively.
- /// See \ref GX2ConvertDepthBufferToTextureSurface() for more information.
- ///
- /// Note 3: The NV12 format is a special case for video. It actually consists of
- /// two surfaces (an 8-bit surface & a 1/4-size 16-bit surface). It is only usable
- /// in certain situations.
- ///
- /// Final note: there may be additional restrictions not yet specified.
- ///
- typedef enum _GX2SurfaceFormat
- {
- /// color write performance relative to hardware peak write (x%)
- /// texture read performance relative to hardware peak read (y%)
- /// these numbers do not consider memory bandwidth limit
- /// there are still some investigations for missing areas
- GX2_SURFACE_FORMAT_INVALID = 0x00000000,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_UNORM = 0x00000001,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_UINT = 0x00000101,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_SNORM = 0x00000201,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_SINT = 0x00000301,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_R4_G4_UNORM = 0x00000002,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TCD_R16_UNORM = 0x00000005,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R16_UINT = 0x00000105,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R16_SNORM = 0x00000205,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R16_SINT = 0x00000305,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R16_FLOAT = 0x00000806,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_G8_UNORM = 0x00000007,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_G8_UINT = 0x00000107,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_G8_SNORM = 0x00000207,
- /// color write (50%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R8_G8_SINT = 0x00000307,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TCS_R5_G6_B5_UNORM = 0x00000008,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R5_G5_B5_A1_UNORM = 0x0000000a,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_R4_G4_B4_A4_UNORM = 0x0000000b,
- /// color write (100%), texture read (100%)
- GX2_SURFACE_FORMAT_TC_A1_B5_G5_R5_UNORM = 0x0000000c, ///< flipped
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R32_UINT = 0x0000010d,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R32_SINT = 0x0000030d,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TCD_R32_FLOAT = 0x0000080e,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_UNORM = 0x0000000f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_UINT = 0x0000010f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_SNORM = 0x0000020f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_SINT = 0x0000030f,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TC_R16_G16_FLOAT = 0x00000810,
- GX2_SURFACE_FORMAT_D_D24_S8_UNORM = 0x00000011, ///< note: same value as below
- GX2_SURFACE_FORMAT_T_R24_UNORM_X8 = 0x00000011, ///< see Note 1
- GX2_SURFACE_FORMAT_T_X24_G8_UINT = 0x00000111, ///< see Note 1
- GX2_SURFACE_FORMAT_D_D24_S8_FLOAT = 0x00000811,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TC_R11_G11_B10_FLOAT = 0x00000816,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TCS_R10_G10_B10_A2_UNORM = 0x00000019,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R10_G10_B10_A2_UINT = 0x00000119,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TC_R10_G10_B10_A2_SNORM = 0x00000219, ///< A2 part is UNORM
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R10_G10_B10_A2_SINT = 0x00000319,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TCS_R8_G8_B8_A8_UNORM = 0x0000001a,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_UINT = 0x0000011a,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_SNORM = 0x0000021a,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_SINT = 0x0000031a,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TCS_R8_G8_B8_A8_SRGB = 0x0000041a,
- /// color write (100%)
- GX2_SURFACE_FORMAT_TCS_A2_B10_G10_R10_UNORM = 0x0000001b, ///< flipped
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_A2_B10_G10_R10_UINT = 0x0000011b, ///< flipped
- GX2_SURFACE_FORMAT_D_D32_FLOAT_S8_UINT_X24 = 0x0000081c, ///< note: same value as below
- GX2_SURFACE_FORMAT_T_R32_FLOAT_X8_X24 = 0x0000081c, ///< note: same value as above
- GX2_SURFACE_FORMAT_T_X32_G8_UINT_X24 = 0x0000011c, ///< see Note 2
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R32_G32_UINT = 0x0000011d,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R32_G32_SINT = 0x0000031d,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R32_G32_FLOAT = 0x0000081e,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_UNORM = 0x0000001f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_UINT = 0x0000011f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_SNORM = 0x0000021f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_SINT = 0x0000031f,
- /// color write (50%)
- GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_FLOAT = 0x00000820,
- /// color write (25%)
- GX2_SURFACE_FORMAT_TC_R32_G32_B32_A32_UINT = 0x00000122,
- /// color write (25%)
- GX2_SURFACE_FORMAT_TC_R32_G32_B32_A32_SINT = 0x00000322,
- /// color write (25%)
- GX2_SURFACE_FORMAT_TC_R32_G32_B32_A32_FLOAT = 0x00000823,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC1_UNORM = 0x00000031,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC1_SRGB = 0x00000431,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC2_UNORM = 0x00000032,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC2_SRGB = 0x00000432,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC3_UNORM = 0x00000033,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC3_SRGB = 0x00000433,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC4_UNORM = 0x00000034,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC4_SNORM = 0x00000234,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC5_UNORM = 0x00000035,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_BC5_SNORM = 0x00000235,
- /// texture read (100%)
- GX2_SURFACE_FORMAT_T_NV12_UNORM = 0x00000081, ///< see Note 3
- GX2_SURFACE_FORMAT_FIRST = GX2_SURFACE_FORMAT_TC_R8_UNORM,
- GX2_SURFACE_FORMAT_LAST = 0x0000083f
- } GX2SurfaceFormat;
- /// \brief Indicates the desired tiling mode for a surface
- ///
- /// You should use only DEFAULT in most cases.
- /// \note: Don't use other modes unless you know what you're doing!
- ///
- typedef enum _GX2TileMode
- {
- GX2_TILE_MODE_DEFAULT = 0x00000000, // driver will choose best mode
- GX2_TILE_MODE_LINEAR_SPECIAL = 0x00000010, // typically not supported by HW
- GX2_TILE_MODE_LINEAR_ALIGNED = 0x00000001, // supported by HW, but not fast
- GX2_TILE_MODE_1D_TILED_THIN1 = 0x00000002,
- GX2_TILE_MODE_1D_TILED_THICK = 0x00000003,
- GX2_TILE_MODE_2D_TILED_THIN1 = 0x00000004, // (a typical default, but not always)
- GX2_TILE_MODE_2D_TILED_THIN2 = 0x00000005,
- GX2_TILE_MODE_2D_TILED_THIN4 = 0x00000006,
- GX2_TILE_MODE_2D_TILED_THICK = 0x00000007,
- GX2_TILE_MODE_2B_TILED_THIN1 = 0x00000008,
- GX2_TILE_MODE_2B_TILED_THIN2 = 0x00000009,
- GX2_TILE_MODE_2B_TILED_THIN4 = 0x0000000a,
- GX2_TILE_MODE_2B_TILED_THICK = 0x0000000b,
- GX2_TILE_MODE_3D_TILED_THIN1 = 0x0000000c,
- GX2_TILE_MODE_3D_TILED_THICK = 0x0000000d,
- GX2_TILE_MODE_3B_TILED_THIN1 = 0x0000000e,
- GX2_TILE_MODE_3B_TILED_THICK = 0x0000000f,
- GX2_TILE_MODE_FIRST = GX2_TILE_MODE_DEFAULT,
- GX2_TILE_MODE_LAST = GX2_TILE_MODE_LINEAR_SPECIAL
- } GX2TileMode;
- /// \brief Indicates how a given surface may be used.
- ///
- /// A "final" TV render target is one that will be copied to a TV scan buffer.
- /// It needs to be designated to handle certain display corner cases.
- /// (When a HD surface must be scaled down to display in NTSC/PAL.)
- ///
- typedef enum _GX2SurfaceUse
- {
- GX2_SURFACE_USE_TEXTURE = 0x001,
- GX2_SURFACE_USE_COLOR_BUFFER = 0x002,
- GX2_SURFACE_USE_DEPTH_BUFFER = 0x004,
- GX2_SURFACE_USE_SCAN_BUFFER = 0x008, // internal use only
- GX2_SURFACE_USE_FTV = (1<<31), // modifier, designates a final TV render target
- //** If changing or adding flags, ensure they match up / don't clash with GX2RResourceFlags
- GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE = GX2_SURFACE_USE_COLOR_BUFFER | GX2_SURFACE_USE_TEXTURE,
- GX2_SURFACE_USE_DEPTH_BUFFER_TEXTURE = GX2_SURFACE_USE_DEPTH_BUFFER | GX2_SURFACE_USE_TEXTURE,
- GX2_SURFACE_USE_COLOR_BUFFER_FTV = GX2_SURFACE_USE_COLOR_BUFFER | GX2_SURFACE_USE_FTV,
- GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE_FTV = GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE | GX2_SURFACE_USE_FTV,
- GX2_SURFACE_USE_FIRST = GX2_SURFACE_USE_TEXTURE,
- GX2_SURFACE_USE_LAST = GX2_SURFACE_USE_SCAN_BUFFER // note: without modifiers!
- } GX2SurfaceUse;
- /// \brief Indicates the "shape" of a given surface or texture.
- ///
- typedef enum _GX2SurfaceDim
- {
- GX2_SURFACE_DIM_1D = 0x000,
- GX2_SURFACE_DIM_2D = 0x001,
- GX2_SURFACE_DIM_3D = 0x002,
- GX2_SURFACE_DIM_CUBE = 0x003,
- GX2_SURFACE_DIM_1D_ARRAY = 0x004,
- GX2_SURFACE_DIM_2D_ARRAY = 0x005,
- GX2_SURFACE_DIM_2D_MSAA = 0x006,
- GX2_SURFACE_DIM_2D_MSAA_ARRAY = 0x007,
- GX2_SURFACE_DIM_FIRST = GX2_SURFACE_DIM_1D,
- GX2_SURFACE_DIM_LAST = GX2_SURFACE_DIM_2D_MSAA_ARRAY
- } GX2SurfaceDim;
- /// \brief Indicates the AA mode (number of samples) for a surface.
- ///
- typedef enum _GX2AAMode
- {
- GX2_AA_MODE_1X = 0x000,
- GX2_AA_MODE_2X = 0x001,
- GX2_AA_MODE_4X = 0x002,
- GX2_AA_MODE_8X = 0x003,
- GX2_AA_MODE_FIRST = GX2_AA_MODE_1X,
- GX2_AA_MODE_LAST = GX2_AA_MODE_8X
- } GX2AAMode;
- // ----------------------------- //
- // Texture Sampler options
- /// \brief Indicates how to treat texture coordinates outside of [0...1] range.
- ///
- typedef enum _GX2TexClamp
- {
- GX2_TEX_CLAMP_WRAP = 0, ///< repeat
- GX2_TEX_CLAMP_MIRROR = 1, ///< mirrored repeat
- GX2_TEX_CLAMP_CLAMP = 2, ///< clamps at the last texel value
- GX2_TEX_CLAMP_MIRROR_ONCE = 3, ///< mirrors once, then clamps like previous option
- GX2_TEX_CLAMP_CLAMP_HALF_BORDER = 4, ///< clamps: values outside are part border, part last texel
- GX2_TEX_CLAMP_MIRROR_ONCE_HALF_BORDER = 5, ///< mirrors once, then clamps like previous option
- GX2_TEX_CLAMP_CLAMP_BORDER = 6, ///< clamps: values outside may be 100% border
- GX2_TEX_CLAMP_MIRROR_ONCE_BORDER = 7, ///< mirrors once, then clamps like previous option
- GX2_TEX_CLAMP_FIRST = GX2_TEX_CLAMP_WRAP,
- GX2_TEX_CLAMP_LAST = GX2_TEX_CLAMP_MIRROR_ONCE_BORDER
- } GX2TexClamp;
- /// \brief Indicates type of border color to use.
- /// \note It's better to avoid using the register color type, as setting
- /// those registers requires a pipeline stall.
- ///
- typedef enum _GX2TexBorderType
- {
- GX2_TEX_BORDER_CLEAR_BLACK = 0, ///< RGBA = (0.0, 0.0, 0.0, 0.0)
- GX2_TEX_BORDER_SOLID_BLACK = 1, ///< RGBA = (0.0, 0.0, 0.0, 1.0)
- GX2_TEX_BORDER_SOLID_WHITE = 2, ///< RGBA = (1.0, 1.0, 1.0, 1.0)
- GX2_TEX_BORDER_USE_REGISTER = 3, ///< RGBA specified using register
- GX2_TEX_BORDER_FIRST = GX2_TEX_BORDER_CLEAR_BLACK,
- GX2_TEX_BORDER_LAST = GX2_TEX_BORDER_USE_REGISTER
- } GX2TexBorderType;
- /// \brief Indicates desired texture filter option within a plane.
- ///
- typedef enum _GX2TexXYFilterType
- {
- GX2_TEX_XY_FILTER_POINT = 0,
- GX2_TEX_XY_FILTER_BILINEAR = 1,
- GX2_TEX_XY_FILTER_FIRST = GX2_TEX_XY_FILTER_POINT,
- GX2_TEX_XY_FILTER_LAST = GX2_TEX_XY_FILTER_BILINEAR
- } GX2TexXYFilterType;
- /// \brief Indicates desired texture filter option between Z planes.
- ///
- typedef enum _GX2TexZFilterType
- {
- GX2_TEX_Z_FILTER_USE_XY = 0, // use same as XY filter modes
- GX2_TEX_Z_FILTER_POINT = 1, // (default)
- GX2_TEX_Z_FILTER_LINEAR = 2, // note: slower than POINT
- GX2_TEX_Z_FILTER_FIRST = GX2_TEX_Z_FILTER_USE_XY,
- GX2_TEX_Z_FILTER_LAST = GX2_TEX_Z_FILTER_LINEAR
- } GX2TexZFilterType;
- /// \brief Indicates desired texture filter option between mip levels.
- ///
- typedef enum _GX2TexMipFilterType
- {
- GX2_TEX_MIP_FILTER_NO_MIP = 0, // disable mipmapping (use base level only)
- GX2_TEX_MIP_FILTER_POINT = 1, // (default)
- GX2_TEX_MIP_FILTER_LINEAR = 2, // note: slower than POINT
- GX2_TEX_MIP_FILTER_FIRST = GX2_TEX_MIP_FILTER_NO_MIP,
- GX2_TEX_MIP_FILTER_LAST = GX2_TEX_MIP_FILTER_LINEAR
- } GX2TexMipFilterType;
- /// \brief Indicates desired performance option for (linear) Z filtering.
- /// If enabled, the Z fractional bits go through a lookup table to adjust
- /// the performance/quality trade-off.
- ///
- typedef enum _GX2TexZPerfType
- {
- // TODO: come up with better names to describe trade-offs
- GX2_TEX_Z_PERF_0 = 0, // disabled: no changes (default)
- GX2_TEX_Z_PERF_1 = 1, // use lookup table 1
- GX2_TEX_Z_PERF_2 = 2, // use lookup table 2
- GX2_TEX_Z_PERF_3 = 3, // use lookup table 3
- GX2_TEX_Z_PERF_FIRST = GX2_TEX_Z_PERF_0,
- GX2_TEX_Z_PERF_LAST = GX2_TEX_Z_PERF_3
- } GX2TexZPerfType;
- /// \brief Indicates desired performance option for (linear) mip filtering.
- /// If enabled, the mip LOD fractional bits go through a lookup table to adjust
- /// the performance/quality trade-off.
- ///
- typedef enum _GX2TexMipPerfType
- {
- // TODO: come up with better names to describe trade-offs
- GX2_TEX_MIP_PERF_0 = 0, // disabled: no changes (default)
- GX2_TEX_MIP_PERF_1 = 1, // use lookup table 1
- GX2_TEX_MIP_PERF_2 = 2, // use lookup table 2
- GX2_TEX_MIP_PERF_3 = 3, // use lookup table 3
- GX2_TEX_MIP_PERF_4 = 4, // use lookup table 4
- GX2_TEX_MIP_PERF_5 = 5, // use lookup table 5
- GX2_TEX_MIP_PERF_6 = 6, // use lookup table 6
- GX2_TEX_MIP_PERF_7 = 7, // use lookup table 7
- GX2_TEX_MIP_PERF_FIRST = GX2_TEX_MIP_PERF_0,
- GX2_TEX_MIP_PERF_LAST = GX2_TEX_MIP_PERF_7
- } GX2TexMipPerfType;
- /// \brief Indicates maximum desired anisotropic filter ratio.
- /// Higher ratios give better image quality, but slower performance.
- ///
- typedef enum _GX2TexAnisoRatio
- {
- GX2_TEX_ANISO_1_TO_1 = 0, // disables anisotropic filtering
- GX2_TEX_ANISO_2_TO_1 = 1, // 2:1
- GX2_TEX_ANISO_4_TO_1 = 2, // 4:1
- GX2_TEX_ANISO_8_TO_1 = 3, // 8:1
- GX2_TEX_ANISO_16_TO_1 = 4, // 16:1
- GX2_TEX_ANISO_FIRST = GX2_TEX_ANISO_1_TO_1,
- GX2_TEX_ANISO_LAST = GX2_TEX_ANISO_16_TO_1
- } GX2TexAnisoRatio;
- // -----------------------------------------------------------------------------
- // Enums - Display / Scan-out
- /// \brief Describes actual video output from the TV encoder.
- ///
- /// This is read-only from the system settings.
- ///
- typedef enum _GX2TVScanMode
- {
- GX2_TV_SCAN_MODE_NONE, // TV output is disabled
- GX2_TV_SCAN_MODE_576I, // Just to let users know that it is PAL
- GX2_TV_SCAN_MODE_480I,
- GX2_TV_SCAN_MODE_480P,
- GX2_TV_SCAN_MODE_720P,
- GX2_TV_SCAN_MODE_RESERVED,
- GX2_TV_SCAN_MODE_1080I,
- GX2_TV_SCAN_MODE_1080P,
- GX2_TV_SCAN_MODE_FIRST = GX2_TV_SCAN_MODE_NONE,
- GX2_TV_SCAN_MODE_LAST = GX2_TV_SCAN_MODE_1080P
- } GX2TVScanMode;
- /// \brief Describes user-setting for TV aspect ratio.
- /// It should only be relevant for 480I/480P.
- ///
- /// This is read-only from the system settings.
- ///
- typedef enum _GX2AspectRatio
- {
- GX2_ASPECT_RATIO_4_BY_3,
- GX2_ASPECT_RATIO_16_BY_9,
- GX2_ASPECT_RATIO_FIRST = GX2_ASPECT_RATIO_4_BY_3,
- GX2_ASPECT_RATIO_LAST = GX2_ASPECT_RATIO_16_BY_9
- } GX2AspectRatio;
- /// \brief Used to describe both the current DRC set up
- /// as well as desired DRC buffering set up.
- ///
- typedef enum _GX2DRCMode
- {
- GX2_DRC_NONE = 0,
- GX2_DRC_SINGLE = 1, // 60Hz
- GX2_DRC_DOUBLE = 2, // 30Hz
- GX2_DRC_SINGLE_30HZ = 3,
- GX2_DRC_FIRST = GX2_DRC_NONE,
- GX2_DRC_LAST = GX2_DRC_SINGLE_30HZ
- } GX2DRCMode;
- /// \brief Used to describe scan buffer setup for TV.
- /// (used mainly to reserve framebuffer memory)
- ///
- typedef enum _GX2TVRenderMode
- {
- GX2_TV_RENDER_NONE, // TV output is unused
- GX2_TV_RENDER_480_NARROW, // 4:3 ratio (640x480)
- GX2_TV_RENDER_480_WIDE, // 16:9 ratio (854x480)
- GX2_TV_RENDER_720, // 16:9 for all the rest...
- GX2_TV_RENDER_RESERVED,
- GX2_TV_RENDER_1080,
- GX2_TV_RENDER_FIRST = GX2_TV_RENDER_NONE,
- GX2_TV_RENDER_LAST = GX2_TV_RENDER_1080
- } GX2TVRenderMode;
- /// \brief Specify the buffering mode.
- ///
- /// \note: Uncertain if this will remain.
- ///
- typedef enum _GX2BufferingMode
- {
- GX2_BUFFERING_SINGLE = 1, // Just for debug
- GX2_BUFFERING_DOUBLE = 2,
- GX2_BUFFERING_TRIPLE = 3,
- GX2_BUFFERING_QUAD = 4,
- GX2_BUFFERING_FIRST = GX2_BUFFERING_SINGLE,
- GX2_BUFFERING_LAST = GX2_BUFFERING_QUAD
- } GX2BufferingMode;
- /// \brief Used to describe where to copy renderbuffers to.
- ///
- /// \todo Adjust as necessary.
- ///
- typedef enum _GX2ScanTarget
- {
- GX2_SCAN_TARGET_TV = 0x1,
- GX2_SCAN_TARGET_TV_LEFT = 0x1, // same as above
- GX2_SCAN_TARGET_TV_RIGHT = 0x2,
- GX2_SCAN_TARGET_DRC_FIRST = 0x4,
- GX2_SCAN_TARGET_DRC_SECOND = 0x8,
- GX2_SCAN_TARGET_FIRST = GX2_SCAN_TARGET_TV,
- GX2_SCAN_TARGET_LAST = GX2_SCAN_TARGET_DRC_SECOND
- } GX2ScanTarget;
- /// \brief indicate which hint is valid
- ///
- typedef enum _GX2DRCEncodingHint
- {
- GX2_DRC_ENCODING_INVALLIDATE = 0x1, ///< (1) invalidates GX2_DRC_ENCODING_MOTION_VECTOR and refresh DRC screen by I-frame
- GX2_DRC_ENCODING_MOTION_VECTOR = 0x4, ///< (4) Motion vector
- GX2_DRC_ENCODING_FIRST = GX2_DRC_ENCODING_INVALLIDATE,
- GX2_DRC_ENCODING_LAST = GX2_DRC_ENCODING_MOTION_VECTOR
- } GX2DRCEncodingHint;
- // -----------------------------------------------------------------------------
- // Enums - Manage
- /// \brief What point in the graphics pipe should a time-stamp event happen?
- ///
- typedef enum _GX2PipeEvent {
- GX2_PIPE_EVENT_TOP, ///< top of pipe
- GX2_PIPE_EVENT_BOTTOM, ///< bottom after reads done, before writes are flushed
- GX2_PIPE_EVENT_BOTTOM_AFTER_FLUSH, ///< bottom after GPU cache flush & invalidate
- GX2_PIPE_EVENT_LAST = GX2_PIPE_EVENT_BOTTOM_AFTER_FLUSH
- } GX2PipeEvent;
- /// \brief Type of user callback event for interrupts
- ///
- typedef enum _GX2CallbackEvent {
- GX2_CB_EVENT_USER_TS_TOP, ///< results from user timestamp (top of pipe) interrupt
- GX2_CB_EVENT_USER_TS_BOTTOM, ///< results from user timestamp (bottom of pipe) interrupt
- GX2_CB_EVENT_VSYNC, ///< results from 60hz vsync
- GX2_CB_EVENT_FLIP, ///< results from scan buffer flipping
- GX2_CB_EVENT_LAST = GX2_CB_EVENT_FLIP
- } GX2CallbackEvent;
- /// \brief Type of GX2 semaphore action
- ///
- typedef enum _GX2SemaphoreAction {
- GX2_SEMAPHORE_WAIT = 0, ///< Wait before processing next command
- GX2_SEMAPHORE_SIGNAL = 1 ///< Signal after all previous work is done
- } GX2SemaphoreAction;
- // -----------------------------------------------------------------------------
- // Enums - Misc
- /// \brief Specifies the type of object being flushed or invalidated.
- ///
- typedef enum _GX2InvalidateType
- {
- GX2_INVALIDATE_ATTRIB_BUFFER = 0x01, // invalidate input caches. main memory read is forced next time
- GX2_INVALIDATE_TEXTURE = 0x02, // invalidate input caches. main memory read is forced next time
- GX2_INVALIDATE_UNIFORM_BLOCK = 0x04, // invalidate input caches. main memory read is forced next time
- GX2_INVALIDATE_SHADER = 0x08, // invalidate input caches. main memory read is forced next time
- GX2_INVALIDATE_COLOR_BUFFER = 0x10, // flush color buffer 0-7's cache into main memory
- GX2_INVALIDATE_DEPTH_BUFFER = 0x20, // flush depth buffer's cache into main memory
- GX2_INVALIDATE_CPU = 0x40, // just flush cpu cache into main memory
- GX2_INVALIDATE_STREAMOUT_BUFFER = 0x80, // flush and invalidate the stream out buffer caches into main memory
- // For convenience, invalidate CPU cache & GPU (input) item together:
- GX2_INVALIDATE_CPU_ATTRIB_BUFFER
- = GX2_INVALIDATE_ATTRIB_BUFFER | GX2_INVALIDATE_CPU,
- GX2_INVALIDATE_CPU_TEXTURE
- = GX2_INVALIDATE_TEXTURE | GX2_INVALIDATE_CPU,
- GX2_INVALIDATE_CPU_UNIFORM_BLOCK
- = GX2_INVALIDATE_UNIFORM_BLOCK | GX2_INVALIDATE_CPU,
- GX2_INVALIDATE_CPU_SHADER
- = GX2_INVALIDATE_SHADER | GX2_INVALIDATE_CPU,
- GX2_INVALIDATE_CONSTANT_BUFFER = 0x04, // deprecated name
- GX2_INVALIDATE_CPU_CONSTANT_BUFFER // deprecated name
- = GX2_INVALIDATE_CONSTANT_BUFFER | GX2_INVALIDATE_CPU,
- GX2_INVALIDATE_FIRST = GX2_INVALIDATE_ATTRIB_BUFFER,
- GX2_INVALIDATE_LAST = 0xff
- } GX2InvalidateType;
- /// \brief Specify possible debug options for processing graphics commands.
- ///
- typedef enum _GX2DebugMode
- {
- GX2_DEBUG_MODE_NONE = 0x00, // debug off
- GX2_DEBUG_MODE_FLUSH_PER_DRAW = 0x01, // perform flush after each draw
- GX2_DEBUG_MODE_DONE_PER_FLUSH = 0x02, // perform DrawDone after each flush
- GX2_DEBUG_MODE_FIRST = 0x00,
- GX2_DEBUG_MODE_LAST = 0x03
- } GX2DebugMode;
- /// \brief Specify possible profiling options to force off features in the graphics pipeline
- ///
- typedef enum _GX2ProfileMode
- {
- GX2_PROFILE_MODE_NONE = 0x00000, ///< (0x00000) None of the options below
- GX2_PROFILE_MODE_INFINITELY_FAST_HARDWARE = 0x00001, ///< (0x00001) Command buffer are built in GX2, but they are not dispatched to the HW
- GX2_PROFILE_MODE_WIREFRAME = 0x00002, ///< (0x00002) Render everything in wireframe mode
- GX2_PROFILE_MODE_DISABLE_ALPHABLEND = 0x00004, ///< (0x00004) Force off color buffer reads
- GX2_PROFILE_MODE_DISABLE_COLORWRITES = 0x00008, ///< (0x00008) Force off color buffer writes
- GX2_PROFILE_MODE_DISABLE_COLOR = 0x00010, ///< (0x00010) Disable color buffer reads and writes
- GX2_PROFILE_MODE_MIN_VERTEX_SHADER = 0x00020, ///< (0x00020) Always execute a minimal vertex shader
- GX2_PROFILE_MODE_MIN_GEOMETRY_SHADER = 0x00040, ///< (0x00040) Always execute a minimal geometry shader
- GX2_PROFILE_MODE_MIN_PIXEL_SHADER = 0x00080, ///< (0x00080) Always execute a minimal pixel shader
- GX2_PROFILE_MODE_MIN_VERTEX_FETCH = 0x00100, ///< (0x00100) Force all vertex fetches from the cache, the stride is set to 0.
- GX2_PROFILE_MODE_MIN_TEXTURE_FETCH = 0x00200, ///< (0x00200) Force all textures to 1 mip level with a 1x1 size
- GX2_PROFILE_MODE_DISABLE_Z = 0x00400, ///< (0x00400) Force off Z buffering, no Z buffer reads or writes
- GX2_PROFILE_MODE_DISABLE_ZWRITES = 0x00800, ///< (0x00800) Force off Z writes
- GX2_PROFILE_MODE_DISABLE_STENCIL = 0x01000, ///< (0x01000) Force off stenciling, no reads or writes from the stencil buffer
- GX2_PROFILE_MODE_DISABLE_TRILINEAR = 0x02000, ///< (0x02000) Force off trilinear texture filtering
- GX2_PROFILE_MODE_DISABLE_ANISO = 0x04000, ///< (0x04000) Force off anisotropic texture filtering
- GX2_PROFILE_MODE_DISABLE_COLOR_CLEARS = 0x08000, ///< (0x08000) Disable color clears
- GX2_PROFILE_MODE_DISABLE_Z_CLEARS = 0x10000, ///< (0x10000) Disable Z clears
- GX2_PROFILE_MODE_DISABLE_STENCIL_CLEARS = 0x20000, ///< (0x20000) Disable stencil clears
- GX2_PROFILE_MODE_DISABLE_EARLY_Z = 0x40000, ///< (0x40000) Only use late Z (when Z is enabled)
- GX2_PROFILE_MODE_FIRST = 0x00000,
- GX2_PROFILE_MODE_LAST = 0x7ffff
- } GX2ProfileMode;
- /// \brief Define different toss points within the graphics pipeline. A toss point is a stage in
- /// the pipeline were all operations that follow are disabled.
- ///
- typedef enum _GX2TossStage
- {
- GX2_TOSS_STAGE_NONE = 0, ///< (0) Full pipeline is enabled
- GX2_TOSS_STAGE_AFTER_VERTEX_FETCH = 1, ///< (1) Vertex fetch only, the rest of the graphics pipeline is disabled
- GX2_TOSS_STAGE_AFTER_VERTEX_SHADER = 2, ///< (2) Vertex fetch and vertex shader only
- GX2_TOSS_STAGE_AFTER_GEOMETRY_SHADER = 3, ///< (3) Vertex fetch, vertex shader, and geometry shader are enabled. The rasterizer (including clipping) is disabled
- GX2_TOSS_STAGE_AFTER_CLIPPING = 4, ///< (4) Enable vertex processing, geometry shader and clipping. All primitives will be culled after clipping
- GX2_TOSS_STAGE_AFTER_PRIMITIVE_SETUP = 5, ///< (5) Enable vertex processing, geometry shader, clipping and primitive setup, but rasterization is disabled
- GX2_TOSS_STAGE_AFTER_SCAN_CONVERSION = 6, ///< (6) Scan conversion, HiZ, and Early Z, but no parameter interpolation
- GX2_TOSS_STAGE_AFTER_RASTERIZATION = 7, ///< (7) Full rasterization, but pixel shader is disabled
- GX2_TOSS_STAGE_AFTER_PIXEL_SHADER = 8, ///< (8) Full rasterization and pixel shader, but color buffer reads and writes are disabled
- GX2_TOSS_STAGE_FIRST = GX2_TOSS_STAGE_NONE,
- GX2_TOSS_STAGE_LAST = GX2_TOSS_STAGE_AFTER_PIXEL_SHADER
- } GX2TossStage;
- /// \brief Specify the endian swap mode
- typedef enum _GX2EndianSwapMode
- {
- GX2_ENDIANSWAP_NONE = 0, ///< No endian swap
- GX2_ENDIANSWAP_8IN16 = 1, ///< 8 in 16 swap
- GX2_ENDIANSWAP_8IN32 = 2, ///< 8 in 32 swap
- GX2_ENDIANSWAP_DEFAULT = 3, ///< endian swap mode is determined based on the format
- GX2_ENDIANSWAP_FIRST = GX2_ENDIANSWAP_NONE,
- GX2_ENDIANSWAP_LAST = GX2_ENDIANSWAP_DEFAULT
- } GX2EndianSwapMode;
- /// \brief Specify tessellation type of mesh
- ///
- typedef enum _GX2TessellationMode {
- GX2_TESSELLATION_MODE_DISCRETE,
- GX2_TESSELLATION_MODE_CONTINUOUS,
- GX2_TESSELLATION_MODE_ADAPTIVE,
- GX2_TESSELLATION_MODE_FIRST = GX2_TESSELLATION_MODE_DISCRETE,
- GX2_TESSELLATION_MODE_LAST = GX2_TESSELLATION_MODE_ADAPTIVE
- } GX2TessellationMode;
- /// \brief Specify fetch shader type.
- ///
- typedef enum GX2FetchShaderType {
- GX2_FETCH_SHADER_TESSELATION_NONE = 0x0,
- GX2_FETCH_SHADER_TESSELATION_LINES = 0x1,
- GX2_FETCH_SHADER_TESSELATION_TRIANGLES = 0x2,
- GX2_FETCH_SHADER_TESSELATION_QUADS = 0x3,
- GX2_FETCH_SHADER_TYPE_FIRST = GX2_FETCH_SHADER_TESSELATION_NONE,
- GX2_FETCH_SHADER_TYPE_LAST = GX2_FETCH_SHADER_TESSELATION_QUADS
- } GX2FetchShaderType;
- /// \brief Specify the query type.
- ///
- /// The CPU query types will be read by the CPU and are not available to be read by the GPU.
- /// The GPU query types will be read by the GPU and are not available to be read by the CPU.
- typedef enum _GX2QueryType
- {
- GX2_QUERY_TYPE_OCCLUSION_CPU, ///< depth-based occlusion CPU query
- GX2_QUERY_TYPE_STREAMOUT_STATS_CPU, ///< stream-out buffer stats CPU query
- GX2_QUERY_TYPE_OCCLUSION_GPU, ///< depth-based occlusion GPU query
- GX2_QUERY_TYPE_STREAMOUT_STATS_GPU, ///< stream-out buffer stats GPU query
- GX2_QUERY_TYPE_FIRST = GX2_QUERY_TYPE_OCCLUSION_CPU,
- GX2_QUERY_TYPE_LAST = GX2_QUERY_TYPE_STREAMOUT_STATS_GPU
- } GX2QueryType;
- /// \brief Specify method of setting streamout offset.
- ///
- typedef enum _GX2StreamOutOffsetInit {
- GX2_STREAMOUT_OFFSET_READ_FROM_CONTEXT = 0x0,
- GX2_STREAMOUT_OFFSET_RESET = 0x1,
- GX2_STREAMOUT_OFFSET_EXPLICIT = 0x2,
- } GX2StreamOutOffsetInit;
- // -----------------
- // User Debug Alerts
- /// \brief (Temporary Placeholder) UDA alert ids
- ///
- typedef enum _GX2UDAAlertID {
- GX2_UDAID_NOALERT = -1,
- GX2_UDAID_ENABLESTATESHADOWING = 0,
- GX2_UDAID_LAST = GX2_UDAID_ENABLESTATESHADOWING
- } GX2UDAAlertID;
- /// \brief (Temporary Placeholder) UDA alert levels
- ///
- typedef enum _GX2UDAAlertLevel
- {
- GX2_UDALEVEL_NONE = 0, // Disable monitoring
- GX2_UDALEVEL_SEVERE = 1, // report usage that may cause hang
- GX2_UDALEVEL_ORDINARY = 2, // report usage that may cause incorrect results (includes SEVERE level)
- GX2_UDALEVEL_PEDANTIC = 3, // report usage that is not recommended (includes SEVERE and ORDINARY level)
- GX2_UDALEVEL_LAST = GX2_UDALEVEL_PEDANTIC
- } GX2UDAAlertLevel;
- // -----------------
- // GX2 Log
- /// \brief Attributes to control GX2 Log function
- ///
- typedef enum _GXLogAttrib {
- GX2_LOG_ATTRIB_ENABLE, ///< Turn logging on or off
- GX2_LOG_ATTRIB_LAST = GX2_LOG_ATTRIB_ENABLE
- } GX2LogAttrib;
- // -----------------
- // Capture related
- /// Tag type for \ref GX2DebugTagUserString
- typedef enum _GX2DebugTagUserStringType
- {
- GX2_DEBUG_TAG_INDENT,
- GX2_DEBUG_TAG_UNDENT,
- GX2_DEBUG_TAG_COMMENT,
- GX2_DEBUG_TAG_BOOKMARK,
- GX2_DEBUG_TAG_FIRST=GX2_DEBUG_TAG_INDENT,
- GX2_DEBUG_TAG_LAST=GX2_DEBUG_TAG_BOOKMARK,
- } GX2DebugTagUserStringType;
- #define GX2_DEBUG_TAG_MAX_SIZE 1024
- /// Options for \ref GX2DebugCaptureStart and \ref GX2DebugCaptureEnd
- typedef enum _GX2DebugCaptureOptions
- {
- GX2_DEBUG_CAPTURE_DEFAULT =0, ///< By default \ref GX2DebugCaptureStart calls GX2DrawDone to sync the GPU and flush any
- ///< previous commands before the capture starts, and \ref GX2DebugCaptureEnd calls GX2Flush
- ///< to capture the current CB before the capture finishes.
- GX2_DEBUG_CAPTURE_NO_FLUSH =0x01, ///< Suppress GX2DrawDone/GX2Flush calls in \ref GX2DebugCaptureStart and \ref GX2DebugCaptureEnd
- } GX2DebugCaptureOptions;
- // -----------------
- // Misc
- /// Misc param selection
- typedef enum _GX2MiscType
- {
- GX2_MISC_HANG_STATE, ///< Is the GPU ok or hung?
- GX2_MISC_HANG_RESPONSE, ///< Action to take upon hang
- GX2_MISC_HANG_RESET_SWAP_TIMEOUT, ///< For auto-hang-detection+reset, time-out value (since last flip happened)
- GX2_MISC_HANG_RESET_SWAP_COUNT ///< For auto-hang-detection+reset, max number of pending swaps permitted
- } GX2MiscType;
- /// Misc values for GPU Hang states
- typedef enum _GX2HangState
- {
- GX2_HANG_STATE_OK = 0, ///< GPU is ok
- GX2_HANG_STATE_TS = 1, ///< time-out waiting for time stamp
- GX2_HANG_STATE_CB = 2, ///< time-out waiting for command buffer space
- GX2_HANG_STATE_RB = 3, ///< time-out waiting for ring buffer space
- GX2_HANG_STATE_WF = 4, ///< time-out waiting for scanbuffer flip
- GX2_HANG_STATE_ETC = 5, ///< GPU is hung based on other (user-set) condition
- } GX2HangState;
- /// Misc values for GPU Hang response
- typedef enum _GX2HangResponse
- {
- GX2_HANG_RESPONSE_NONE, ///< Do nothing automatically
- GX2_HANG_RESPONSE_DEBUG, ///< Do a GPU state dump & infinite loop
- GX2_HANG_RESPONSE_RESET ///< Do a GPU reset during GX2SwapScanBuffers
- } GX2HangResponse;
- /// @}
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #endif // _CAFE_GX2_ENUM_H_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement