PSP Cache issues

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

PSP Cache issues

Post by siberianstar »

Hello, i'm getting some problem with cache. I'm using GU to draw sprites and 3d but something it's displayed and something not. It's a cache problem.

I've tried to use

sceKernelDcacheWritebackInvalidateRange

for vertex data. But it didn't solve my problem at all, there is still something not drawn. Where should i flush the cache ? After what gu/gum functions?
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Try:

Code: Select all

sceKernelDcacheWritebackAll();
Just after you start your game loop. (ie. your while loop or whatever)

[EDIT] You should get your own personal thread!
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Post by siberianstar »

i've tried but it's not working good. Damn.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Then I would suggest that it isn't a cache issue at all.
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Post by siberianstar »

Yes it's a cache issue because if i try to

for (int x = 0; x < 20; x++)
sceKernelDcacheWritebackAll();

it seems working, but that's not the right solution
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

If it doesn't display correctly after one call, then it's more likely the texture upload isn't synced at the time you're drawing or your drawing code is messed up all together.
Try sceGuTexSync() and if that doesn't help, provide more code.
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Post by siberianstar »

i'm not using

sceGuCopyImage

to copy image into vram. I'm just doing

sceGumDrawArray with GU_SPRITE and texture in the main ram.
User avatar
ReKleSS
Posts: 73
Joined: Sat Jun 18, 2005 12:57 pm
Location: Melbourne, Australia

Post by ReKleSS »

The reason you write back the cache stuff is so that when the GU tried to read out of system ram, what's in system ram is what you actually wrote there. You want to place your sceKernelDcacheWritebackAll just before where the GU should be reading out the data. Generally, put them before sceGumDrawArray - that's what gets the GU to actually start doing stuff.
Post Reply