State update problem with GX_SetTevOrder

Post Reply
Samson
Posts: 35
Joined: Mon May 19, 2008 8:05 am

State update problem with GX_SetTevOrder

Post by Samson » Tue Aug 19, 2008 8:33 am

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.

shagkur
Posts: 53
Joined: Thu Sep 08, 2005 8:40 pm

Re: State update problem with GX_SetTevOrder

Post by shagkur » Mon Nov 17, 2008 1:45 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests