citro3d
attribs.h
Go to the documentation of this file.
1 /**
2  * @file attribs.h
3  * @brief Configure vertex attributes
4  */
5 #pragma once
6 #include "types.h"
7 
8 /// Vertex attribute info
9 typedef struct
10 {
11  u32 flags[2];
12  u64 permutation;
13  int attrCount;
14 } C3D_AttrInfo;
15 
16 /**
17  * @brief Resets and initializes \ref C3D_AttrInfo structure to default values.
18  * @param[out] info Pointer to attribute info structure.
19  */
21 
22 /**
23  * @brief Defines an array of vertex attribute data.
24  * @note The attribute index returned should be the same as the order used
25  * when specifying \ref AttrInfo_AddLoader() and \ref AttrInfo_AddFixed().
26  * @param[out] info Attribute info structure.
27  * @param[in] regId Specifies the attribute register in the vertex shader that will be modified.
28  * @param[in] format Specifies the data type of the array.
29  * @param[in] count Specifies the length of the array.
30  * @return Attribute index if successful, negative value on failure.
31  */
32 int AttrInfo_AddLoader(C3D_AttrInfo* info, int regId, GPU_FORMATS format, int count);
33 
34 /**
35  * @brief Defines a fixed vertex attribute.
36  * @note The attribute index returned should be the same as the order used
37  * when specifying \ref AttrInfo_AddLoader() and \ref AttrInfo_AddFixed().
38  * @param[out] info Attribute info structure.
39  * @param[in] regId Specifies the attribute register in the vertex shader that will be modified.
40  * @return Attribute index if successful, negative value on failure.
41  */
42 int AttrInfo_AddFixed(C3D_AttrInfo* info, int regId);
43 
44 /**
45  * @brief Gets pointer to the global \ref C3D_AttrInfo structure.
46  * @return Pointer to global \ref C3D_AttrInfo. This should not be freed.
47  */
49 
50 /**
51  * @brief Sets global \ref C3D_AttrInfo structure.
52  * Copies values from the specified \ref C3D_AttrInfo structure to the
53  * global \ref C3D_AttrInfo structure.
54  * @param[in] info Pointer to user \ref C3D_AttrInfo.
55  */
int AttrInfo_AddLoader(C3D_AttrInfo *info, int regId, GPU_FORMATS format, int count)
Defines an array of vertex attribute data.
void C3D_SetAttrInfo(C3D_AttrInfo *info)
Sets global C3D_AttrInfo structure. Copies values from the specified C3D_AttrInfo structure to the gl...
int AttrInfo_AddFixed(C3D_AttrInfo *info, int regId)
Defines a fixed vertex attribute.
void AttrInfo_Init(C3D_AttrInfo *info)
Resets and initializes C3D_AttrInfo structure to default values.
C3D_AttrInfo * C3D_GetAttrInfo(void)
Gets pointer to the global C3D_AttrInfo structure.
GPU_FORMATS
Vertex attribute info.
Definition: attribs.h:10
uint64_t u64
uint32_t u32