forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PSP Cache issues

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Fri Jul 14, 2006 4:34 am    Post subject: PSP Cache issues Reply with quote

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?
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Jul 14, 2006 4:39 am    Post subject: Reply with quote

Try:

Code:
sceKernelDcacheWritebackAll();


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

[EDIT] You should get your own personal thread!
Back to top
View user's profile Send private message
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Fri Jul 14, 2006 5:05 am    Post subject: Reply with quote

i've tried but it's not working good. Damn.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Jul 14, 2006 5:16 am    Post subject: Reply with quote

Then I would suggest that it isn't a cache issue at all.
Back to top
View user's profile Send private message
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Fri Jul 14, 2006 5:48 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Fri Jul 14, 2006 6:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Fri Jul 14, 2006 6:21 am    Post subject: Reply with quote

i'm not using

sceGuCopyImage

to copy image into vram. I'm just doing

sceGumDrawArray with GU_SPRITE and texture in the main ram.
Back to top
View user's profile Send private message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Fri Jul 14, 2006 7:11 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group