Page 1 of 1

GX_InvalidateTexAll() does nothing

Posted: Sat Jan 20, 2024 3:49 am
by Oaisus
Hello!

I've been trying for several days to get this to work and at this point I am convinced that it is a bug.

According to the docs if I modify a texture in main memory and call GX_InvalidateTexAll() it's supposed to reload the texture into the texture cache, but it just doesn't work on real hardware. It works in dolphin for some reason though.

I can even change to a completely different texture image with GX_InitTexObjData() and that works fine but just changing pixels in the texture does nothing.

I've attached an example program that shows a spinning white textured cube and pressing left or right on the dpad of a gamecube controller in the player one slot should erase pixels on the texture.

Am I just doing something wrong?

Re: GX_InvalidateTexAll() does nothing

Posted: Sat Jan 20, 2024 4:53 pm
by Oaisus
I finally got it working. Apparently I needed to manually flush the cpu cache to main memory.

From the

Code: Select all

#include <ogc/cache.h>
header, I added

Code: Select all

DCFlushRange(texarray, 0x400);
after changing the texture