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 

VRAM Usage

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



Joined: 27 Jul 2005
Posts: 46

PostPosted: Wed Mar 29, 2006 5:44 am    Post subject: VRAM Usage Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Wed Mar 29, 2006 5:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Garak



Joined: 27 Jul 2005
Posts: 46

PostPosted: Wed Mar 29, 2006 8:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
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