libctru/libctru/include/3ds/gpu/shbin.h

79 lines
1.3 KiB
C
Raw Normal View History

#pragma once
2014-03-08 12:43:16 +01:00
2015-01-03 04:16:23 +01:00
#include <3ds/gpu/gpu.h>
2014-03-08 12:43:16 +01:00
typedef enum{
2015-01-03 04:16:23 +01:00
VERTEX_SHDR=GPU_VERTEX_SHADER,
GEOMETRY_SHDR=GPU_GEOMETRY_SHADER
2015-01-03 02:15:44 +01:00
}DVLE_type;
2014-03-08 12:43:16 +01:00
2015-01-03 04:16:23 +01:00
typedef enum{
DVLE_CONST_BOOL=0x0,
DVLE_CONST_u8=0x1,
DVLE_CONST_FLOAT24=0x2,
}DVLE_constantType;
2014-03-08 12:43:16 +01:00
typedef enum{
RESULT_POSITION = 0x0,
2014-12-27 20:22:48 +01:00
RESULT_NORMALQUAT = 0x1,
2014-03-08 12:43:16 +01:00
RESULT_COLOR = 0x2,
RESULT_TEXCOORD0 = 0x3,
2014-12-27 20:22:48 +01:00
RESULT_TEXCOORD0W = 0x4,
2014-03-08 12:43:16 +01:00
RESULT_TEXCOORD1 = 0x5,
2014-12-27 20:22:48 +01:00
RESULT_TEXCOORD2 = 0x6,
RESULT_VIEW = 0x8
2015-01-03 02:15:44 +01:00
}DVLE_outputAttribute_t;
2014-03-08 12:43:16 +01:00
typedef struct{
u32 codeSize;
u32* codeData;
u32 opdescSize;
u32* opcdescData;
}DVLP_s;
typedef struct{
2015-01-03 04:16:23 +01:00
u16 type;
u16 id;
2014-03-08 12:43:16 +01:00
u32 data[4];
}DVLE_constEntry_s;
typedef struct{
u16 type;
u16 regID;
2014-12-27 20:22:48 +01:00
u8 mask;
u8 unk[3];
2014-03-08 12:43:16 +01:00
}DVLE_outEntry_s;
2014-03-13 15:34:01 +01:00
typedef struct{
u32 symbolOffset;
u16 startReg;
u16 endReg;
}DVLE_uniformEntry_s;
2014-03-08 12:43:16 +01:00
typedef struct{
2015-01-03 02:15:44 +01:00
DVLE_type type;
2015-01-03 04:16:23 +01:00
DVLP_s* dvlp;
2014-03-08 12:43:16 +01:00
u32 mainOffset, endmainOffset;
u32 constTableSize;
DVLE_constEntry_s* constTableData;
u32 outTableSize;
DVLE_outEntry_s* outTableData;
2014-03-13 15:34:01 +01:00
u32 uniformTableSize;
DVLE_uniformEntry_s* uniformTableData;
char* symbolTableData;
2015-01-03 04:16:23 +01:00
u8 outmapMask;
u32 outmapData[8];
2014-03-08 12:43:16 +01:00
}DVLE_s;
typedef struct{
u32 numDVLE;
DVLP_s DVLP;
DVLE_s* DVLE;
}DVLB_s;
DVLB_s* DVLB_ParseFile(u32* shbinData, u32 shbinSize);
void DVLB_Free(DVLB_s* dvlb);
2014-03-09 16:38:55 +01:00
s8 DVLE_GetUniformRegister(DVLE_s* dvle, const char* name);
2015-01-03 04:16:23 +01:00
void DVLE_GenerateOutmap(DVLE_s* dvle);