3DS: Slightly refactor GPU operations

This commit is contained in:
Vicki Pfau 2020-08-25 03:20:52 -07:00
parent 07c2c87d00
commit fcda3df24d
1 changed files with 4 additions and 5 deletions

View File

@ -80,6 +80,10 @@ bool ctrInitGpu(void) {
AttrInfo_AddLoader(attrInfo, 2, GPU_UNSIGNED_BYTE, 4); // in_col AttrInfo_AddLoader(attrInfo, 2, GPU_UNSIGNED_BYTE, 4); // in_col
AttrInfo_AddLoader(attrInfo, 3, GPU_FLOAT, 2); // in_rot AttrInfo_AddLoader(attrInfo, 3, GPU_FLOAT, 2); // in_rot
C3D_BufInfo* bufInfo = C3D_GetBufInfo();
BufInfo_Init(bufInfo);
BufInfo_Add(bufInfo, ctrVertexBuffer, sizeof(struct ctrUIVertex), 4, 0x3210);
return true; return true;
} }
@ -213,13 +217,8 @@ void ctrStartFrame(void) {
ctrNumVerts = 0; ctrNumVerts = 0;
ctrVertStart = 0; ctrVertStart = 0;
activeTexture = NULL; activeTexture = NULL;
C3D_BufInfo* bufInfo = C3D_GetBufInfo();
BufInfo_Init(bufInfo);
BufInfo_Add(bufInfo, ctrVertexBuffer, sizeof(struct ctrUIVertex), 4, 0x3210);
} }
void ctrEndFrame(void) { void ctrEndFrame(void) {
ctrFlushBatch(); ctrFlushBatch();
GSPGPU_FlushDataCache(ctrVertexBuffer, sizeof(struct ctrUIVertex) * ctrNumVerts);
} }