citro3d/include/c3d/attribs.h

57 lines
1.9 KiB
C
Raw Normal View History

2024-01-17 03:31:31 +01:00
/**
* @file attribs.h
* @brief Configure vertex attributes
*/
2014-12-20 21:34:19 +01:00
#pragma once
#include "types.h"
2024-01-17 03:31:31 +01:00
/// Vertex attribute info
2014-12-20 21:34:19 +01:00
typedef struct
{
u32 flags[2];
u64 permutation;
int attrCount;
} C3D_AttrInfo;
2024-01-17 03:31:31 +01:00
/**
* @brief Resets and initializes \ref C3D_AttrInfo structure to default values.
* @param[out] info Pointer to attribute info structure.
*/
2014-12-20 21:34:19 +01:00
void AttrInfo_Init(C3D_AttrInfo* info);
2024-01-17 03:31:31 +01:00
/**
* @brief Defines an array of vertex attribute data.
* @note The attribute index returned should be the same as the order used
* when specifying \ref AttrInfo_AddLoader() and \ref AttrInfo_AddFixed().
* @param[out] info Attribute info structure.
* @param[in] regId Specifies the attribute register in the vertex shader that will be modified.
* @param[in] format Specifies the data type of the array.
* @param[in] count Specifies the length of the array.
* @return Attribute index if successful, negative value on failure.
*/
int AttrInfo_AddLoader(C3D_AttrInfo* info, int regId, GPU_FORMATS format, int count);
2024-01-17 03:31:31 +01:00
/**
* @brief Defines a fixed vertex attribute.
* @note The attribute index returned should be the same as the order used
* when specifying \ref AttrInfo_AddLoader() and \ref AttrInfo_AddFixed().
* @param[out] info Attribute info structure.
* @param[in] regId Specifies the attribute register in the vertex shader that will be modified.
* @return Attribute index if successful, negative value on failure.
*/
int AttrInfo_AddFixed(C3D_AttrInfo* info, int regId);
2014-12-20 21:34:19 +01:00
2024-01-17 03:31:31 +01:00
/**
* @brief Gets pointer to the global \ref C3D_AttrInfo structure.
* @return Pointer to global \ref C3D_AttrInfo. This should not be freed.
*/
2014-12-20 21:34:19 +01:00
C3D_AttrInfo* C3D_GetAttrInfo(void);
2024-01-17 03:31:31 +01:00
/**
* @brief Sets global \ref C3D_AttrInfo structure.
* Copies values from the specified \ref C3D_AttrInfo structure to the
* global \ref C3D_AttrInfo structure.
* @param[in] info Pointer to user \ref C3D_AttrInfo.
*/
2014-12-20 21:34:19 +01:00
void C3D_SetAttrInfo(C3D_AttrInfo* info);