I've got a question about VIF->GIF DMA packets optimisation, currently I'm sending to the VU a bunch of 4 vertices geometry information (ST RGBAQ XYZ2)*4 after the TEX01 texture information
So I was wondering, why only 4 ? As I'm using Triangle strips, why not sending in one paquet 40 vertices and associated data ? I've got 16Kb to fill !
But as I need to fill the NREGS register, it only permits me to send 16 different GIF registers so how can I send 40*3+1 = 121 regs in one packet ? Should I resend a GIF tag/PRIM each 16 regs ?
And is it obvious that this is better to send few large VIF packets after having computing all geometry information than lots of "small" ones but non blocking and doing MIPS computation within dma sends...
Hope I'm clear enough...
Code: Select all
*((u64*)p_data)++ = DMA_CNT_TAG( 14 );
// VIF_CODE(CMD,NUM,IMMEDIATE)
*((u32*)p_data)++ = VIF_CODE( VIF_STCYL,0,0x0404 );
*((u32*)p_data)++ = VIF_CODE( VIF_UNPACK_V4_32,14, 4); //14 blocks 4*u32, starting at index 4
// GIF_TAG(NLOOP,EOP,PRE,PRIM,FLG,NREG)
// GS_SETREG_PRIM(prim, iip, tme, fge, abe, aa1, fst, ctxt, fix)
*((u64*)p_data)++ = GIF_TAG( 1, 1, 1, GS_SETREG_PRIM( GS_PRIM_PRIM_TRISTRIP,
1, 1, 0, 0, 0, 0, 0, 0 ), 0, 13 );
*((u64*)p_data)++ = (u64)(0x5125125125126);
// NREGS : XYZ2 RGBAQ ST XYZ2 RGBAQ ST XYZ2 RGBAQ ST XYZ2 RGBAQ ST TEX01 from right to left
...