Page 1 of 1

State update problem with GX_SetTevOrder

Posted: Tue Aug 19, 2008 8:33 am
by Samson
I seem to have a problem with state updates when using GX_SetTevOrder. Before I delve into the guts of gx.c, has anyone else looked into this?
The problem is, that my shader setup works differently depending on what shader I run before. If I run

Code: Select all

	GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD1, GX_TEXMAP1, GX_COLOR0A0);
	initQuad(); // vertex setup 
	drawQuad(1.0f); // draw a single quad with 4 vertices, I assume that is required because state is not written until a GX_Begin()
and then my shader setup, it works.

My shader uses

Code: Select all

	GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD2, GX_TEXMAP_NULL, GX_COLORZERO);
to pass texture coordinates to the indirect texture unit.

Re: State update problem with GX_SetTevOrder

Posted: Mon Nov 17, 2008 1:45 pm
by shagkur
Hi,

to prevent from this you should issue a GX_Flush after you've finished drawing the primitive(i.e. after GX_End).
GX_Flush does not only write down the 32bytes to the WGP it also writes down certain
shadow regs to the WGP. Mainly all those settings which correspond to texcoord gen and TEV setup.

regards
shagkur

PS: perhaps you already figured that.