GX_InvalidateTexAll() does nothing

Post Reply
Oaisus
Posts: 2
Joined: Sat Jan 20, 2024 2:48 am

GX_InvalidateTexAll() does nothing

Post by Oaisus » Sat Jan 20, 2024 3:49 am

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?
Attachments
example.zip
example program
(3.95 KiB) Downloaded 537 times
main.cpp
example program main file
(6.76 KiB) Downloaded 549 times

Oaisus
Posts: 2
Joined: Sat Jan 20, 2024 2:48 am

Re: GX_InvalidateTexAll() does nothing

Post by Oaisus » Sat Jan 20, 2024 4:53 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest