| View previous topic :: View next topic |
| Author |
Message |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Fri Jul 14, 2006 4:34 am Post subject: PSP Cache issues |
|
|
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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Fri Jul 14, 2006 4:39 am Post subject: |
|
|
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 |
|
 |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Fri Jul 14, 2006 5:05 am Post subject: |
|
|
| i've tried but it's not working good. Damn. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Fri Jul 14, 2006 5:16 am Post subject: |
|
|
| Then I would suggest that it isn't a cache issue at all. |
|
| Back to top |
|
 |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Fri Jul 14, 2006 5:48 am Post subject: |
|
|
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 |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Fri Jul 14, 2006 6:14 am Post subject: |
|
|
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 |
|
 |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Fri Jul 14, 2006 6:21 am Post subject: |
|
|
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 |
|
 |
ReKleSS

Joined: 18 Jun 2005 Posts: 73 Location: Melbourne, Australia
|
Posted: Fri Jul 14, 2006 7:11 pm Post subject: |
|
|
| 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 |
|
 |
|