| View previous topic :: View next topic |
| Author |
Message |
Garak
Joined: 27 Jul 2005 Posts: 46
|
Posted: Wed Mar 29, 2006 5:44 am Post subject: VRAM Usage |
|
|
Greetings,
I am using SDL to make a game. I have implemented some code to allow me to load an image into VRAM. When I place the image in VRAM, it comes well after my screen buffers. I noticed that for some reason, one of my images does not seem to copy in the last row of pixels when being transfered from sytem memory to VRAM.
I have tried using a single memcpy to go from SRAM to VRAM, as well as copying the image byte by byte. If I simply copy the size of my image, plus 1 extra row of pixels, I get the whole image.
To blit the image, I use the standard SDL_BlitSurface function. Is there any reson why my image does not seem to copy completly?
Garak |
|
| Back to top |
|
 |
Brunni
Joined: 08 Oct 2005 Posts: 186
|
Posted: Wed Mar 29, 2006 5:52 am Post subject: |
|
|
You have to flush the data cache (sceKernelDcacheWritebackInvalidateAll) before drawing the image. _________________ Sorry for my bad english
Oldschool library for PSP - PC version released |
|
| Back to top |
|
 |
Garak
Joined: 27 Jul 2005 Posts: 46
|
Posted: Wed Mar 29, 2006 8:06 am Post subject: |
|
|
Thanks,
Would this need to be done each time the image is drawn, or just once after copying the image?
I am not drawing the images to the screen, SDL is doing that. I imagine SDL is using memcpy to move the data from the SDL Image to the screen buffer. Would you really need to call sceKernelDcacheWritebackInvalidateAll in that case, I thought that command was for when you were using PSP GU commands to draw images.
Garak |
|
| Back to top |
|
 |
|